mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 12:14:43 +00:00
Update codegen.rs
This commit is contained in:
parent
d5e9649172
commit
c3660e4014
1 changed files with 11 additions and 1 deletions
|
@ -332,7 +332,9 @@ impl PyCodeGenerator {
|
||||||
} else {
|
} else {
|
||||||
jump_to
|
jump_to
|
||||||
};
|
};
|
||||||
if !CommonOpcode::is_jump_op(*self.cur_block_codeobj().code.get(idx - 1).unwrap()) {
|
if idx == 0
|
||||||
|
|| !CommonOpcode::is_jump_op(*self.cur_block_codeobj().code.get(idx - 1).unwrap())
|
||||||
|
{
|
||||||
self.crash(&format!("calc_edit_jump: not jump op: {idx} {jump_to}"));
|
self.crash(&format!("calc_edit_jump: not jump op: {idx} {jump_to}"));
|
||||||
}
|
}
|
||||||
self.edit_code(idx, arg);
|
self.edit_code(idx, arg);
|
||||||
|
@ -886,6 +888,14 @@ impl PyCodeGenerator {
|
||||||
println!("current block: {}", self.cur_block());
|
println!("current block: {}", self.cur_block());
|
||||||
panic!("internal error: {description}");
|
panic!("internal error: {description}");
|
||||||
} else {
|
} else {
|
||||||
|
let err = CompileError::compiler_bug(
|
||||||
|
0,
|
||||||
|
self.input().clone(),
|
||||||
|
Location::Unknown,
|
||||||
|
fn_name!(),
|
||||||
|
line!(),
|
||||||
|
);
|
||||||
|
err.write_to_stderr();
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue