revive-yul: fix the code block exit (#414)

This PR fixes the missing `STOP` instruction at the end of `code`
blocks.

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-11-17 18:47:58 +01:00
committed by GitHub
parent dd48baadc7
commit a1090cfa5a
3 changed files with 105 additions and 0 deletions
+3
View File
@@ -64,6 +64,9 @@ impl PolkaVMWriteLLVM for Code {
fn into_llvm(self, context: &mut PolkaVMContext) -> anyhow::Result<()> {
self.block.into_llvm(context)?;
// The EVM lets the code return implicitly.
revive_llvm_context::polkavm_evm_return::stop(context)?;
Ok(())
}
}