You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to get this to work and I'm not sure what I'm doing wrong here. I'm attempting to implement outputting bytecode to a file, however I'm noticing that regardless of how many times I run it my output is including stuff that makes zero sense
staticintlua_main(lua_State *L) {
// load our Lua file as a chunk on the stack (if filename is NULL it loads from stdin)if ( luaL_loadfile(L, g_sInputFilename ) != 0 ) {
fprintf(stderr, "%s\n", lua_tostring(L, -1));
return0;
}
// return early if we only want parsingif (g_bParseOnly) {
return0;
}
char *bytecode = 0L;
size_t len = 0;
wdata wd = {&len, &bytecode};
if (lua_bcwrite(L, write_dump, &wd, g_bStripDebug)) {
fprintf(stderr, "failed to dump bytecode\n");
return0;
}
// output bytecode to stdout
FILE * pFile = fopen( strcat( g_sInputFilename, ".bc" ), "wb" );
fwrite( bytecode, len, sizeof( bytecode ), pFile );
fclose( pFile );
return0;
}
This is the file I've used to test, and for what ever reason it's dumping extra irrelevant content into the file.
The only modification I've done is adding the part at the bottom to the function above in order to get the content into a file instead of just printing it test.lua_stripped.txt
The text was updated successfully, but these errors were encountered:
I've been trying to get this to work and I'm not sure what I'm doing wrong here. I'm attempting to implement outputting bytecode to a file, however I'm noticing that regardless of how many times I run it my output is including stuff that makes zero sense
This is the file I've used to test, and for what ever reason it's dumping extra irrelevant content into the file.
The only modification I've done is adding the part at the bottom to the function above in order to get the content into a file instead of just printing it
test.lua_stripped.txt
The text was updated successfully, but these errors were encountered: