Skip to content

Commit

Permalink
Fix assert for lastDefBeforeFirstUse
Browse files Browse the repository at this point in the history
Summary:
An assert was incorrectly computing the last def before first use, causing false assert failures.

#utd-hermes-ignore-wasm

Reviewed By: dulinriley

Differential Revision: D26695876

fbshipit-source-id: 1d81b54dc97e46bb48a9b3d5d8a18000d664411f
  • Loading branch information
kodafb authored and facebook-github-bot committed Feb 26, 2021
1 parent 0871b4d commit 581c46b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion API/hermes/TraceInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ std::unordered_map<ObjectID, TraceInterpreter::DefAndUse> createGlobalMap(
defs.size() &&
"There must be at least one def for any globally used object");
// The defs here are global record numbers.
uint64_t lastDefBeforeFirstUse = *defs.begin();
uint64_t lastDefBeforeFirstUse = 0;
for (uint64_t def : defs) {
if (def < firstUse) {
lastDefBeforeFirstUse = std::max(lastDefBeforeFirstUse, def);
Expand Down

0 comments on commit 581c46b

Please sign in to comment.