File tree Expand file tree Collapse file tree 4 files changed +62
-4
lines changed Expand file tree Collapse file tree 4 files changed +62
-4
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ std::vector<SuffixTree::RepeatedSubstring> StringifyProcessor::filter(
204
204
void walk (Expression* curr) {
205
205
hasFilterValue = false ;
206
206
Super::walk (curr);
207
+ flushControlFlowQueue ();
207
208
}
208
209
209
210
void addUniqueSymbol (SeparatorReason reason) {}
Original file line number Diff line number Diff line change @@ -42,9 +42,7 @@ inline void StringifyWalker<SubType>::doWalkFunction(Function* func) {
42
42
addUniqueSymbol (SeparatorReason::makeFuncStart (func));
43
43
Super::walk (func->body );
44
44
addUniqueSymbol (SeparatorReason::makeEnd ());
45
- while (!controlFlowQueue.empty ()) {
46
- dequeueControlFlow ();
47
- }
45
+ flushControlFlowQueue ();
48
46
}
49
47
50
48
template <typename SubType>
Original file line number Diff line number Diff line change @@ -191,7 +191,11 @@ struct StringifyWalker
191
191
static void scan (SubType* self, Expression** currp);
192
192
static void doVisitExpression (SubType* self, Expression** currp);
193
193
194
- private:
194
+ void flushControlFlowQueue () {
195
+ while (!controlFlowQueue.empty ()) {
196
+ dequeueControlFlow ();
197
+ }
198
+ }
195
199
void dequeueControlFlow ();
196
200
};
197
201
Original file line number Diff line number Diff line change 1109
1109
unreachable
1110
1110
)
1111
1111
)
1112
+
1113
+ ;; Tests that restricted expressions (local.set) are filtered from outlining
1114
+ ;; even when nested within control flow.
1115
+ (module
1116
+ ;; CHECK: (type $0 (func))
1117
+
1118
+ ;; CHECK: (func $a (type $0)
1119
+ ;; CHECK-NEXT: (local $x i32)
1120
+ ;; CHECK-NEXT: (if
1121
+ ;; CHECK-NEXT: (i32.const 0)
1122
+ ;; CHECK-NEXT: (then
1123
+ ;; CHECK-NEXT: (local.set $x
1124
+ ;; CHECK-NEXT: (i32.const 1)
1125
+ ;; CHECK-NEXT: )
1126
+ ;; CHECK-NEXT: )
1127
+ ;; CHECK-NEXT: )
1128
+ ;; CHECK-NEXT: )
1129
+ (func $a
1130
+ (local $x i32 )
1131
+ (block
1132
+ (if
1133
+ (i32.const 0 )
1134
+ (then
1135
+ (local.set $x
1136
+ (i32.const 1 )
1137
+ )
1138
+ )
1139
+ )
1140
+ )
1141
+ )
1142
+ ;; CHECK: (func $b (type $0)
1143
+ ;; CHECK-NEXT: (local $x i32)
1144
+ ;; CHECK-NEXT: (if
1145
+ ;; CHECK-NEXT: (i32.const 0)
1146
+ ;; CHECK-NEXT: (then
1147
+ ;; CHECK-NEXT: (local.set $x
1148
+ ;; CHECK-NEXT: (i32.const 1)
1149
+ ;; CHECK-NEXT: )
1150
+ ;; CHECK-NEXT: )
1151
+ ;; CHECK-NEXT: )
1152
+ ;; CHECK-NEXT: )
1153
+ (func $b
1154
+ (local $x i32 )
1155
+ (block
1156
+ (if
1157
+ (i32.const 0 )
1158
+ (then
1159
+ (local.set $x
1160
+ (i32.const 1 )
1161
+ )
1162
+ )
1163
+ )
1164
+ )
1165
+ )
1166
+ )
You can’t perform that action at this time.
0 commit comments