Skip to content

Commit

Permalink
save/restore alloca table inside functions
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 26, 2024
1 parent c75a273 commit c647456
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vyper/venom/ir_node_to_venom.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,14 @@ def _handle_self_call(fn: IRFunction, ir: IRnode, symbols: SymbolTable) -> Optio
def _handle_internal_func(
fn: IRFunction, ir: IRnode, does_return_data: bool, symbols: SymbolTable
) -> IRFunction:
global _alloca_table

fn = fn.ctx.create_function(ir.args[0].args[0].value)
bb = fn.get_basic_block()

_saved_alloca_table = _alloca_table
_alloca_table = {}

# return buffer
if does_return_data:
symbols["return_buffer"] = bb.append_instruction("param")
Expand All @@ -191,6 +196,7 @@ def _handle_internal_func(

_convert_ir_bb(fn, ir.args[0].args[2], symbols)

_alloca_table = _saved_alloca_table
return fn


Expand Down

0 comments on commit c647456

Please sign in to comment.