diff options
author | bloodstalker <thabogre@gmail.com> | 2018-02-01 09:41:13 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-02-01 09:41:13 +0000 |
commit | bb36d843120d0f30c8930c0cf430e265b0374f25 (patch) | |
tree | 6e8b1e3406472c06c4d10ee9e79502fcb864d3b5 /bruiser/bruiser.cpp | |
parent | fixed string type for xobjs, also xcall can now call functions by name as well (diff) | |
download | mutator-bb36d843120d0f30c8930c0cf430e265b0374f25.tar.gz mutator-bb36d843120d0f30c8930c0cf430e265b0374f25.zip |
update
Diffstat (limited to 'bruiser/bruiser.cpp')
-rw-r--r-- | bruiser/bruiser.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index a052b64..e75b173 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -1066,7 +1066,7 @@ class LiveActionListArrays : public ASTFrontendAction class LuaWrapper { public: - LuaWrapper(ClangTool &__CT, Executioner& __EX) : CT(__CT), executioner(__EX) {} + LuaWrapper(ClangTool &__CT, Executioner& __EX, XGlobals __XG) : CT(__CT), executioner(__EX), xglobals(__XG) {} /*print out the history*/ int BruiserLuaHistory(lua_State* __ls) @@ -1396,12 +1396,15 @@ class LuaWrapper } int BruiserLuaXObjAllocGlobal(lua_State* __ls) { - int nuamrgs = lua_gettop(__ls); + int numargs = lua_gettop(__ls); + if (numargs != 2) {PRINT_WITH_COLOR_LB(RED, "expected exactly two args. did not get that.");} std::string glob_name = lua_tostring(__ls , 1); size_t size = lua_tointeger(__ls, 2); + xglobals.reserve(size); return 0; } - int BruiserLuaXObjAllocAllGlobals(lua_State* __ls) {return 0;} + + int BruiserLuaXObjAllocAllGlobals(lua_State* __ls) {} /*read the m0 report*/ int BruiserLuaM0(lua_State* __ls) @@ -1913,6 +1916,7 @@ class LuaWrapper private: ClangTool CT; Executioner executioner; + XGlobals xglobals; }; /**********************************************************************************************************************/ /**********************************************************************************************************************/ @@ -1958,7 +1962,7 @@ int main(int argc, const char **argv) { } /*initialize the LuaWrapper class so we can register and run them from lua.*/ - LuaWrapper LW(Tool, executioner); + LuaWrapper LW(Tool, executioner, xglobals); /*linenoise init*/ linenoiseSetCompletionCallback(bruiser::ShellCompletion); |