You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None => panic!("num_unclosed_ifs != 0 but the undo_info call_stack is empty"),// the last block in the call stack
139
+
None => panic!("Not all OP_IF or OP_NOTIF are closed in the chunk but undoing/removing scripts from the end of the chunk violates the set tolerance. Number of unmatched OP_IF/OP_NOTIF: {}", undo_info.num_unclosed_ifs),// the last block in the call stack
// No OP_IF, OP_NOTIF or OP_ENDIF in that structured script so just remove it
188
+
// No OP_IF, OP_NOTIF or OP_ENDIF in that structured script so we will not include
189
+
// it in the chunk.
195
190
removed_len += builder.len();
196
191
removed_scripts.push(builder);
197
192
}
198
193
}
199
194
200
195
self.call_stack.extend(removed_scripts);
201
-
assert!(num_unclosed_ifs >= 0,"More OP_ENDIF's than OP_IF's after undo step. (This means there is a bug in the undo logic.)");
202
-
assert_eq!(num_unclosed_ifs,0,"Unable to make up for the OP_IF's in this chunk. Consider a larger target size or more tolerance. Unclosed OP_IF's: {:?}, removed_len: {}, undo.call_stack: {:?}, chunks: {:?}", num_unclosed_ifs, removed_len, undo_info.call_stack,self.chunks.iter().map(|chunk| chunk.size).collect::<Vec<_>>());
203
196
(undo_info.call_stack, removed_len)
204
197
}
205
198
206
199
fnfind_next_chunk(&mutself) -> Chunk{
207
200
letmut chunk_scripts = vec![];
208
201
letmut chunk_len = 0;
209
-
letmut num_unclosed_ifs = 0;
210
202
211
203
// All not selected StructuredScripts that have to be added to the call_stack again
0 commit comments