|
valgrind check result:
==23341== Invalid read of size 1
==23341== at 0x4934BE2: luaV_execute (lvm.c:727) ==23341== by 0x4928E77: luaD_call (ldo.c:377) ==23341== by 0x4926069: f_call (lapi.c:800) ==23341== by 0x4928251: luaD_rawrunprotected (ldo.c:118) ==23341== by 0x4929198: luaD_pcall (ldo.c:463) ==23341== by 0x49260EC: lua_pcall (lapi.c:821) ==23341== by 0x4923407: sys_include (port_system.c:52) ==23341== by 0x4928C5C: luaD_precall (ldo.c:319) ==23341== by 0x49344CB: luaV_execute (lvm.c:590) ==23341== by 0x4928E77: luaD_call (ldo.c:377) ==23341== by 0x4926069: f_call (lapi.c:800) ==23341== by 0x4928251: luaD_rawrunprotected (ldo.c:118) ==23341== Address 0x42D4588 is 72 bytes inside a block of size 76 free'd ==23341== at 0x401B257: free (vg_replace_malloc.c:233) ==23341== by 0x493641C: l_alloc (lauxlib.c:631) ==23341== by 0x492BA94: luaM_realloc_ (lmem.c:79) ==23341== by 0x4929DE5: luaF_freeproto (lfunc.c:148) ==23341== by 0x492AD9E: freeobj (lgc.c:380) ==23341== by 0x492AEF5: sweeplist (lgc.c:424) ==23341== by 0x492B5CE: singlestep (lgc.c:583) ==23341== by 0x492B6CE: luaC_step (lgc.c:617) ==23341== by 0x4934CCB: luaV_execute (lvm.c:739) ==23341== by 0x4928E77: luaD_call (ldo.c:377) ==23341== by 0x4926069: f_call (lapi.c:800) ==23341== by 0x4928251: luaD_rawrunprotected (ldo.c:118) sys_include func is just like:
(dofile(file)) (); -- load another lua file and
execute
the included file should like this:
(function ()
local localfunc = ...
globalfunc = ...
end)()
2011-11-15
文曦畅 |