{"action":"created","issue":{"url":"https://api.github.com/repos/jgressmann/pokemon/issues/2","labels_url":"https://api.github.com/repos/jgressmann/pokemon/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jgressmann/pokemon/issues/2/comments","events_url":"https://api.github.com/repos/jgressmann/pokemon/issues/2/events","html_url":"https://github.com/jgressmann/pokemon/issues/2","id":108479483,"number":2,"title":"thanks, work nown, new assert problem","user":{"login":"gcclua","id":11599645,"avatar_url":"https://avatars.githubusercontent.com/u/11599645?v=3","gravatar_id":"","url":"https://api.github.com/users/gcclua","html_url":"https://github.com/gcclua","followers_url":"https://api.github.com/users/gcclua/followers","following_url":"https://api.github.com/users/gcclua/following{/other_user}","gists_url":"https://api.github.com/users/gcclua/gists{/gist_id}","starred_url":"https://api.github.com/users/gcclua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcclua/subscriptions","organizations_url":"https://api.github.com/users/gcclua/orgs","repos_url":"https://api.github.com/users/gcclua/repos","events_url":"https://api.github.com/users/gcclua/events{/privacy}","received_events_url":"https://api.github.com/users/gcclua/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-26T16:42:39Z","updated_at":"2015-09-29T08:13:54Z","closed_at":null,"body":"DebuggerState::Mnemonize()\r\n...\r\n            assert(!lua_rawequal(L, index, handleTableIndex)); //@@@@@ here assert fail\r\n            assert(!lua_rawequal(L, index, refTableIndex));\r\n...\r\n\r\nmy lua function is\r\n\r\nfunction _LoginPacket_create()\r\n\tlocal o = {};\r\n--LoginPacket.__index = LoginPacket;\r\n--setmetatable(o, LoginPacket);\r\nreturn o;\r\nend\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jgressmann/pokemon/issues/comments/143981182","html_url":"https://github.com/jgressmann/pokemon/issues/2#issuecomment-143981182","issue_url":"https://api.github.com/repos/jgressmann/pokemon/issues/2","id":143981182,"user":{"login":"gcclua","id":11599645,"avatar_url":"https://avatars.githubusercontent.com/u/11599645?v=3","gravatar_id":"","url":"https://api.github.com/users/gcclua","html_url":"https://github.com/gcclua","followers_url":"https://api.github.com/users/gcclua/followers","following_url":"https://api.github.com/users/gcclua/following{/other_user}","gists_url":"https://api.github.com/users/gcclua/gists{/gist_id}","starred_url":"https://api.github.com/users/gcclua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcclua/subscriptions","organizations_url":"https://api.github.com/users/gcclua/orgs","repos_url":"https://api.github.com/users/gcclua/repos","events_url":"https://api.github.com/users/gcclua/events{/privacy}","received_events_url":"https://api.github.com/users/gcclua/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T08:13:54Z","updated_at":"2015-09-29T08:13:54Z","body":"Hi Cheers, \r\n        lua's version is 5.1.4 , I has fixed something, main update is add  luaL_loadbuffer() support\r\n\r\n        thanks \r\n        kiler         \r\n  \r\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\npokemon.cpp\r\n\r\nbool\r\nGetLocation(lua_State* L, const lua_Debug& dbg, BufferPtr& filePathBuffer, const char*& filePath, int& line) {\r\n    const int before = lua_gettop(L);\r\n    bool result = true;\r\n    line = dbg.currentline;\r\n    filePath = \"\";\r\n//##kiler: fixed for path error that use luaL_loadbuffer()\r\n#if 1      \r\n    char c0 = dbg.source[0];\r\n    if (c0 == '@') \r\n    {\r\n        filePath = dbg.source + 1;\r\n    }\r\n    else if(c0 >= 'a' && c0 <='z')\r\n    {\r\n        filePath = dbg.source;\r\n    }\r\n    else if(c0 >='A' && c0 <='Z')\r\n    {\r\n        filePath = dbg.source;\r\n    }\r\n    else\r\n    {\r\n        result = false;\r\n    }\r\n    \r\n    //if(result == true)\r\n    //{\r\n    //    assert(strstr(dbg.source,\".lua\")>0);\r\n    //}\r\n#else\r\n    if (dbg.source[0] == '@') {\r\n        filePath = dbg.source + 1;\r\n    } else {\r\n        GetPokemonTable(L, Pokemon_Locations);\r\n        int pops = 1;\r\n        lua_rawgeti(L, -1, 1);\r\n        ++pops;\r\n        const int entries = (int)lua_tointeger(L, -1);\r\n        if (entries) { // possible no one pushed a location\r\n            lua_rawgeti(L, -2, entries + 1);\r\n            ++pops;\r\n            size_t len;\r\n            const char* location = lua_tolstring(L, -1, &len);\r\n            const char* colon = strchr(location, ':');\r\n            assert(colon);\r\n            const size_t filePathLen = len - (colon - location) - 1;\r\n            filePathBuffer.reset(buf_alloc(filePathLen + 1));\r\n            if (filePathBuffer.get()) {\r\n                memcpy(filePathBuffer->beg, colon + 1, filePathLen);\r\n                filePathBuffer->beg[filePathLen] = 0;\r\n                filePath = (char*)filePathBuffer->beg;\r\n                if (line <= 0) {\r\n                    line = 1;\r\n                }\r\n                line += strtol(location, NULL, 10);\r\n            } else {\r\n                result = false;\r\n            }\r\n        } else {\r\n            result = false;\r\n        }\r\n        lua_pop(L, pops);\r\n    }\r\n#endif\r\n    if (result) {\r\n        if (!is_absolute_file_path(filePath)) {\r\n            buffer* buf = NULL;\r\n            result = to_absolute_file_path(&filePath, &buf);\r\n            if (result) {\r\n                assert(buf);\r\n                filePathBuffer.reset(buf);\r\n            }\r\n        }\r\n    }\r\n\r\n    const int after = lua_gettop(L);\r\n    assert(before == after);\r\n    POKEMON_UNUSED(before);\r\n    POKEMON_UNUSED(after);\r\n\r\n    return result;\r\n}\r\n\r\n\r\n\r\n\r\n     "}}