mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 10:23:20 +00:00
Update codegen.rs
This commit is contained in:
parent
9eb7e8e9ba
commit
ea14f8b2ba
1 changed files with 2 additions and 0 deletions
|
@ -441,6 +441,8 @@ impl CodeGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
/// NOTE: For example, an operation that increases the stack by 2 and decreases it by 1 should be `stack_inc_n(2); stack_dec();` not `stack_inc(1);`.
|
||||
/// This is because the stack size will not increase correctly.
|
||||
fn stack_inc_n(&mut self, n: usize) {
|
||||
self.mut_cur_block().stack_len += n as u32;
|
||||
if self.cur_block().stack_len > self.cur_block_codeobj().stacksize {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue