mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 19:15:43 +00:00
Remove useless_const optimization
There could be jump depending on the Pop being there, and then it breaks.
This commit is contained in:
parent
b8726f03df
commit
bff58fd626
3 changed files with 11 additions and 23 deletions
|
@ -848,7 +848,9 @@ impl<O: OutputStream> Compiler<O> {
|
|||
|
||||
// Emit None at end:
|
||||
match body.last().map(|s| &s.node) {
|
||||
Some(ast::StatementType::Return { .. }) => {}
|
||||
Some(ast::StatementType::Return { .. }) => {
|
||||
// the last instruction is a ReturnValue already, we don't need to emit it
|
||||
}
|
||||
_ => {
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue