mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 21:01:10 +00:00
Update codegen.rs
This commit is contained in:
parent
c15944c8e7
commit
c927d16bb8
1 changed files with 3 additions and 1 deletions
|
@ -378,7 +378,9 @@ impl PyCodeGenerator {
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
let delta = self.jump_delta(code);
|
let delta = self.jump_delta(code);
|
||||||
let bytes = u32::try_from(code + delta).unwrap().to_be_bytes();
|
let shift_bytes = 6;
|
||||||
|
let arg = code + delta + shift_bytes;
|
||||||
|
let bytes = u32::try_from(arg).unwrap().to_be_bytes();
|
||||||
let before_instr = self.lasti().saturating_sub(1);
|
let before_instr = self.lasti().saturating_sub(1);
|
||||||
self.mut_cur_block_codeobj().code.push(bytes[3]);
|
self.mut_cur_block_codeobj().code.push(bytes[3]);
|
||||||
self.mut_cur_block().lasti += 1;
|
self.mut_cur_block().lasti += 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue