diff options
author | James R. McKaskill <james@foobar.co.nz> | 2012-04-23 08:25:57 +0400 |
---|---|---|
committer | James R. McKaskill <james@foobar.co.nz> | 2012-04-23 08:25:57 +0400 |
commit | 4d4379dfcc11a0d8eda14010d006c5df44939bcd (patch) | |
tree | c76fafa2ed61769cf826fe4125d8cf2cdecd832d /ffi.h | |
parent | ba38f94673ab4dc874255ae8d8852ead4b3fe4d8 (diff) |
Process escapes in __asm strings
Diffstat (limited to 'ffi.h')
-rw-r--r-- | ffi.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -116,6 +116,17 @@ static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { #define lua_setuservalue lua_setfenv #define lua_getuservalue lua_getfenv #define lua_rawlen lua_objlen +static char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t sz) { + if (sz > LUAL_BUFFERSIZE) { + luaL_error(L, "string too long"); + } + luaL_buffinit(L, B); + return luaL_prepbuffer(B); +} +static void luaL_pushresultsize(luaL_Buffer* B, size_t sz) { + luaL_addsize(B, sz); + luaL_pushresult(B); +} #endif /* architectures */ |