                 ir.createBr body_bb
                         
                 @currentFunction = null
-                @currentAllocas = {}
 
                 ir.setInsertPoint insertBlock
 

        # this method assumes it's called in an opencoded context
        emitEjsvalTo: (val, type, prefix) ->
                if @options.target_pointer_size is 64
                        #  %1 = and i64 %val, 140737488355327
                        #  %2 = inttoptr i64 %1 to %struct._EJSObject*
                        payload = ir.createAnd val, (consts.int64_lowhi 0x7fff, 0xffffffff), "#{prefix}_payload"
                        ir.createIntToPtr payload, type, "#{prefix}_load"
                else
                        throw new Error "emitEjsvalTo not implemented for this case"

        # this method assumes it's called in an opencoded context
        emitLoadEjsFunctionClosureEnv: (closure) ->
                if @options.target_pointer_size is 64
                        env_slot_gep = ir.createInBoundsGetElementPointer closure, [consts.int64(1), consts.int32(1)], "env_slot_gep"
                        env_slot = ir.createBitCast env_slot_gep, types.EjsValue.pointerTo(), "env_slot"
                        ir.createLoad env_slot, "env_load"
                else
