Index: runtime/vm/scopes.cc |
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc |
index f8af769c6fdfbad25e3fbbdf9f861357e3a0753c..86932ded0565babceab1646b117a4b877a543404 100644 |
--- a/runtime/vm/scopes.cc |
+++ b/runtime/vm/scopes.cc |
@@ -540,20 +540,18 @@ bool LocalVariable::Equals(const LocalVariable& other) const { |
} |
-// Map the frame index into an index in the range 0..(var_count-1). |
-int LocalVariable::BitIndexIn(intptr_t var_count) const { |
+int LocalVariable::BitIndexIn(intptr_t fixed_param_count) const { |
ASSERT(!is_captured()); |
// Parameters have positive indexes with the lowest index being 2. Locals |
// and copied parameters have negative indexes with the lowest (closest to |
// zero) index being ParsedFunction::kFirstLocalSlotIndex. |
if (index() > 0) { |
// Shift non-negative indexes so that the lowest one is 0. |
- return index() - 2; |
+ return (fixed_param_count - 1) - (index() - 2); |
} else { |
// Shift negative indexes so that the lowest one is 0 (they are still |
// non-positive) and index them backward from the end of the vector. |
- return (var_count - 1) + |
- (index() - ParsedFunction::kFirstLocalSlotIndex); |
+ return fixed_param_count - (index() - ParsedFunction::kFirstLocalSlotIndex); |
} |
} |