Skip to content

Commit dc95187

Browse files
authored
Fix address sanitizer warning (#330)
1 parent b8f423b commit dc95187

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Source/LuaBridge/detail/CFunctions.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,7 @@ struct CFunc
191191
*/
192192
static int readOnlyError(lua_State* L) noexcept
193193
{
194-
try
195-
{
196-
std::string s;
197-
s = s + "'" + lua_tostring(L, lua_upvalueindex(1)) + "' is read-only";
198-
return luaL_error(L, s.c_str());
199-
}
200-
catch (...)
201-
{
202-
return luaL_error(L, "Property is read-only");
203-
}
194+
return luaL_error(L, "'%s' is read-only'", lua_tostring(L, lua_upvalueindex(1)));
204195
}
205196

206197
//----------------------------------------------------------------------------

0 commit comments

Comments
 (0)