Skip to content

Commit 103a098

Browse files
alexmarkovCommit Queue
authored and
Commit Queue
committed
[vm,debugger] Do not stop at hoisted variable declarations when stepping through patterns
TEST=pkg/vm_service/test/step_through_patterns_test.dart Issue: #51812 Issue: #49755 Change-Id: Ieb2e6f49c613c7543e7e76119cefbc4d8f9ae3de Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291840 Commit-Queue: Alexander Markov <[email protected]> Reviewed-by: Ben Konyi <[email protected]>
1 parent 3da80be commit 103a098

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

pkg/vm_service/test/step_through_patterns_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,11 @@ List<String> expected = [
4343
"$FILE:${LINE + 0}:46", // on 'shape' after 'switch'
4444
"$FILE:${LINE + 1}:20", // on ':'
4545
"$FILE:${LINE + 2}:20", // on ':'
46-
"$FILE:${LINE + 1}:26", // on 'l' right after 'var'
4746
"$FILE:${LINE + 1}:7", // on 'Square'
48-
"$FILE:${LINE + 2}:26", // on 'r' right after 'var'
4947
"$FILE:${LINE + 2}:7", // on 'Circle'
5048
"$FILE:${LINE + 2}:26", // on 'r' right after 'var'
5149
"$FILE:${LINE + 2}:36", // on '>='
52-
"$FILE:${LINE + 3}:26", // on 'l' right after 'var'
5350
"$FILE:${LINE + 1}:7", // on 'Square'
54-
"$FILE:${LINE + 4}:26", // on 'r' right after 'var'
5551
"$FILE:${LINE + 2}:7", // on 'Circle'
5652
"$FILE:${LINE + 4}:26", // on 'r' right after 'var'
5753
"$FILE:${LINE + 4}:36", // on '<'

runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5802,7 +5802,7 @@ Fragment StreamingFlowGraphBuilder::BuildVariableDeclaration(
58025802
? helper.equals_position_
58035803
: helper.position_;
58045804
if (position != nullptr) *position = helper.position_;
5805-
if (NeedsDebugStepCheck(stack(), debug_position)) {
5805+
if (NeedsDebugStepCheck(stack(), debug_position) && !helper.IsHoisted()) {
58065806
instructions = DebugStepCheck(debug_position) + instructions;
58075807
}
58085808
instructions += StoreLocal(helper.position_, variable);

0 commit comments

Comments
 (0)