Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index a99f0dae7e797f1e118d3f956683b547f684c899..c87a6f67127ab771a3206d47717784fc95678306 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -720,8 +720,12 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(const BytecodeLabel& target, |
BytecodeLabel* label) { |
DCHECK(!label->is_bound()); |
DCHECK(target.is_bound()); |
- PatchJump(bytecodes()->begin() + target.offset(), |
- bytecodes()->begin() + label->offset()); |
+ if (label->is_forward_target()) { |
+ // An earlier jump instruction refers to this label. Update it's location. |
+ PatchJump(bytecodes()->begin() + target.offset(), |
+ bytecodes()->begin() + label->offset()); |
+ // Now treat as if the label will only be back referred to. |
+ } |
label->bind_to(target.offset()); |
LeaveBasicBlock(); |
return *this; |