Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
fix luap.pir
Browse files Browse the repository at this point in the history
prevent loading lua.pbc & languages/lua/lua.pbc
  • Loading branch information
fperrad committed May 21, 2009
1 parent 61374db commit 0bbfd9e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/POSTGrammar.tg
Expand Up @@ -96,7 +96,13 @@ PIRCODE
$S0 = post.'subid'()
start.'push_pirop'('inline', $S0, 'inline'=><<'PIRCODE')
# print "start\n"
load_bytecode "languages/lua/lua.pbc"
$I0 = stat 'lua.pbc', .STAT_EXISTS
unless $I0 goto L1
load_bytecode 'lua.pbc'
goto L2
L1:
load_bytecode 'languages/lua/lua.pbc'
L2:
lua_openlibs()
.local pmc env
env = get_hll_global "_G"
Expand All @@ -105,16 +111,17 @@ PIRCODE
.const "Sub" main = "%0"
main."setfenv"(env)
($I0, $P0) = docall(main, vararg :flat)
unless $I0 goto L1
unless $I0 goto L3
printerr "luap: "
printerr $P0
L1:
L3:
PIRCODE
post.'outer'(start)
start.'push'(post)
$P0 = get_hll_global ['Lua'; 'POST'], 'Chunk'
.tailcall $P0.'new'(start, 'node'=>node, 'prologue'=><<'PIRCODE')
.include "interpinfo.pasm"
.include 'stat.pasm'
.HLL "lua"
.loadlib "lua_group"
PIRCODE
Expand Down

0 comments on commit 0bbfd9e

Please sign in to comment.