From 1dd156f5167d9949eccb7abcbc65d9bc74f49ee8 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 14 Aug 2018 23:31:25 +0200 Subject: [PATCH] Fix use of signed integers in JSON back-end Signed-off-by: Clifford Wolf --- backends/json/json.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backends/json/json.cc b/backends/json/json.cc index d3b7077a2..1a3ca64a3 100644 --- a/backends/json/json.cc +++ b/backends/json/json.cc @@ -93,8 +93,10 @@ struct JsonWriter f << get_string(param.second.decode_string()); else if (GetSize(param.second.bits) > 32) f << get_string(param.second.as_string()); - else + else if ((param.second.flags & RTLIL::ConstFlags::CONST_FLAG_SIGNED) != 0) f << stringf("%d", param.second.as_int()); + else + f << stringf("%u", param.second.as_int()); first = false; } } -- 2.30.2