translate-c: only detect ints as negative if they are signed.
parent
b2662e443d
commit
584cb1fcfe
|
@ -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<BigInt>(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;
|
||||
|
|
Loading…
Reference in New Issue