mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +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) {
|
fn stack_inc_n(&mut self, n: usize) {
|
||||||
self.mut_cur_block().stack_len += n as u32;
|
self.mut_cur_block().stack_len += n as u32;
|
||||||
if self.cur_block().stack_len > self.cur_block_codeobj().stacksize {
|
if self.cur_block().stack_len > self.cur_block_codeobj().stacksize {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue