mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 21:01:10 +00:00
Fix: #230
cause of overflow
This commit is contained in:
parent
998f267c6c
commit
292a6c9301
1 changed files with 3 additions and 0 deletions
|
@ -753,6 +753,9 @@ impl PyCodeGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cancel_if_pop_top(&mut self) {
|
fn cancel_if_pop_top(&mut self) {
|
||||||
|
if self.cur_block_codeobj().code.len() < 2 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let lasop_t_idx = self.cur_block_codeobj().code.len() - 2;
|
let lasop_t_idx = self.cur_block_codeobj().code.len() - 2;
|
||||||
if self.cur_block_codeobj().code.get(lasop_t_idx) == Some(&(POP_TOP as u8)) {
|
if self.cur_block_codeobj().code.get(lasop_t_idx) == Some(&(POP_TOP as u8)) {
|
||||||
self.mut_cur_block_codeobj().code.pop();
|
self.mut_cur_block_codeobj().code.pop();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue