Skip to content

Commit aaa5348

Browse files
Fix _Bool JSON output
1 parent 2461ecf commit aaa5348

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/util/json_expr.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,15 @@ json_objectt json(
266266
result["binary"]=json_stringt(expr.is_true()?"1":"0");
267267
result["data"]=jsont::json_boolean(expr.is_true());
268268
}
269+
else if(type.id()==ID_c_bool)
270+
{
271+
result["name"]=json_stringt("integer");
272+
result["c_type"]=json_stringt("_Bool");
273+
result["binary"]=json_stringt(expr.get_string(ID_value));
274+
mp_integer b;
275+
to_integer(to_constant_expr(expr), b);
276+
result["data"]=json_stringt(integer2string(b));
277+
}
269278
else
270279
{
271280
result["name"]=json_stringt("unknown");

0 commit comments

Comments
 (0)