Skip to content

Commit b0b8bbc

Browse files
Adding assertions to prevent the "data" field from not being set
1 parent fd80fe6 commit b0b8bbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/json_expr.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ json_objectt json(
293293
mp_integer i;
294294
if(!to_integer(expr, i))
295295
result["data"]=json_stringt(integer2string(i));
296+
else
297+
assert(false && "could not convert data to integer");
296298
}
297299
else if(type.id()==ID_c_enum)
298300
{
@@ -304,6 +306,8 @@ json_objectt json(
304306
mp_integer i;
305307
if(!to_integer(expr, i))
306308
result["data"]=json_stringt(integer2string(i));
309+
else
310+
assert(false && "could not convert data to integer");
307311
}
308312
else if(type.id()==ID_c_enum_tag)
309313
{

0 commit comments

Comments
 (0)