authorgravatar for sahnvour@pm.meSahnvour <sahnvour@pm.me> 2019-01-26 15:53:19+01:00
committergravatar for sahnvour@pm.meSahnvour <sahnvour@pm.me> 2019-01-26 15:53:19+01:00
log584cb1fcfea5ff9f708719e345d621af24fa141f
tree11a1be0e5c4a423396aaba77e2963d4a2dfc07fb
parentb2662e443dac700efcc5c14bfb5ccb89a60cdb60

translate-c: only detect ints as negative if they are signed.


1 files changed, 1 insertions(+), 1 deletions(-)

src/translate_c.cpp+1-1
......@@ -468,7 +468,7 @@ static const char *decl_name(const Decl *decl) {
468468static AstNode *trans_create_node_apint(Context *c, const llvm::APSInt &aps_int) {
469469 AstNode *node = trans_create_node(c, NodeTypeIntLiteral);
470470 node->data.int_literal.bigint = allocate<BigInt>(1);
471 bool is_negative = aps_int.isNegative();
471 bool is_negative = aps_int.isSigned() && aps_int.isNegative();
472472 if (!is_negative) {
473473 bigint_init_data(node->data.int_literal.bigint, aps_int.getRawData(), aps_int.getNumWords(), false);
474474 return node;