Skip to content

Commit

Permalink
Fix Switch-related bug in instrSuccOffsets
Browse files Browse the repository at this point in the history
Summary: The offsets are relative to the Switch instruction.

Reviewed By: @jdelong

Differential Revision: D1848966
  • Loading branch information
ottoni authored and hhvm-bot committed Feb 18, 2015
1 parent bd4e0be commit 9f0256e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hphp/runtime/vm/hhbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ OffsetSet instrSuccOffsets(Op* opc, const Unit* unit) {

if (isSwitch(*opc)) {
foreachSwitchTarget(opc, [&](Offset& offset) {
succBcOffs.insert(offset);
succBcOffs.insert(offset + opc - bcStart);
});
} else {
Offset target = instrJumpTarget(bcStart, opc - bcStart);
Expand Down

0 comments on commit 9f0256e

Please sign in to comment.