Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 committed Sep 23, 2022
1 parent 2a8872f commit cf76258
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function main(filename, resourceName, resource, options) {
`Segment and section with that name already exists: ${options.machoSegmentName}/${sectionName}`
);
console.log("Use --overwrite to overwrite the existing content");
process.exit(2);
process.exit(1);
}
}
break;
Expand All @@ -96,7 +96,7 @@ async function main(filename, resourceName, resource, options) {
if (result === postject.InjectResult.kAlreadyExists) {
console.log(`Section with that name already exists: ${sectionName}`);
console.log("Use --overwrite to overwrite the existing content");
process.exit(2);
process.exit(1);
}
}
break;
Expand All @@ -118,15 +118,15 @@ async function main(filename, resourceName, resource, options) {
`Resource with that name already exists: ${resourceName}`
);
console.log("Use --overwrite to overwrite the existing content");
process.exit(2);
process.exit(1);
}
}
break;
}

if (result !== postject.InjectResult.kSuccess) {
console.log("Error when injecting resource");
process.exit(3);
process.exit(1);
}

try {
Expand Down
6 changes: 3 additions & 3 deletions src/postject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ enum class ExecutableFormat { kELF, kMachO, kPE, kUnknown };
enum class InjectResult { kAlreadyExists, kError, kSuccess };

std::vector<uint8_t> vec_from_val(const emscripten::val& value) {
// NOTE - vecFromJSArray incurs a copy, so memory usage is higher than it
// needs to be. Explore ways to access the memory directly and avoid
// the copy.
// TODO(dsanders11) - vecFromJSArray incurs a copy, so memory usage is higher
// than it needs to be. Explore ways to access the memory
// directly and avoid the copy.
return emscripten::vecFromJSArray<uint8_t>(value);
}

Expand Down

0 comments on commit cf76258

Please sign in to comment.