diff --git a/src/translate_c.cpp b/src/translate_c.cpp index 54a97039d..4cd8ed5a5 100644 --- a/src/translate_c.cpp +++ b/src/translate_c.cpp @@ -468,7 +468,7 @@ static const char *decl_name(const Decl *decl) { static AstNode *trans_create_node_apint(Context *c, const llvm::APSInt &aps_int) { AstNode *node = trans_create_node(c, NodeTypeIntLiteral); node->data.int_literal.bigint = allocate(1); - bool is_negative = aps_int.isNegative(); + bool is_negative = aps_int.isSigned() && aps_int.isNegative(); if (!is_negative) { bigint_init_data(node->data.int_literal.bigint, aps_int.getRawData(), aps_int.getNumWords(), false); return node;