lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm having a strange problem with loading my compiled chunks on a different
platform. I'm compiling a text script into a byte-code chunk via luac, and
loading it on the PS2. Both sides are built from the same source and
headers, which have been converted to use floats instead of doubles and
32-bit integers instead of 64. However even the simplest script gives an
"unexpected end of file in " message when it is parsed by the PS2 Lua
system. Running the same script through the standard lua interpreter
compiled on the PC parses properly. If I substitute standard (64 bit)
versions of lua and luac, then everything correctly identifies that theres a
mismatch between number sizes (4 vs 8), so I don't think its a number size
thing.

What I'd like to know is whether there are any structure packing settings,
alignment issues, or other general things to be aware of when loading
compiled lua scripts. My PS2 loading code is as simple as loading the script
into a buffer, concatenating a NULL character to the end of it (to make sure
text buffers are NULL terminated), and passing that buffer off to
lua_dobuffer. Also, how is Lua detecting the end of file? I don't see any
obvious record of the file size internal to the format, I don't pass the
size to lua_dobuffer, and I don't see an obvious EOF character, so I assume
some parse logic determines when there is no more data to read...?

Thanks
ChrisC