allow check-structures-sanity to check the size of the value explicitly specified in a lua expression rather than just its descendants.

print an error if getting the type identity fails.
develop
Ben Lubar 2020-02-19 11:40:31 -06:00
parent f81587bd82
commit ee6b281ae3
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 2 additions and 0 deletions

@ -165,12 +165,14 @@ static command_result command(color_ostream & out, std::vector<std::string> & pa
ToCheck ref;
ref.path.push_back(parameters.at(0));
ref.path.push_back(""); // tell check_struct that it is a pointer
ref.ptr = get_object_ref(State, -1);
lua_getfield(State, -1, "_type");
lua_getfield(State, -1, "_identity");
ref.identity = reinterpret_cast<type_identity *>(lua_touserdata(State, -1));
if (!ref.identity)
{
out.printerr("could not determine type identity\n");
return CR_FAILURE;
}