From 4a7f1c0c1d9418e7d220110c5a0ec732f755c284 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 17 Sep 2014 15:36:47 +0200 Subject: compiler: do << and | on unsigned ints only --- orc/orccompiler.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/orc/orccompiler.c b/orc/orccompiler.c index bfb220f..1acb0ff 100644 --- a/orc/orccompiler.c +++ b/orc/orccompiler.c @@ -1052,25 +1052,26 @@ orc_compiler_get_constant (OrcCompiler *compiler, int size, int value) { int i; int tmp; + unsigned int v = value; if (size < 4) { if (size < 2) { - value &= 0xff; - value |= (value<<8); + v &= 0xff; + v |= (v<<8); } - value &= 0xffff; - value |= (value<<16); + v &= 0xffff; + v |= (v<<16); } for(i=0;in_constants;i++){ if (compiler->constants[i].is_long == FALSE && - compiler->constants[i].value == value) { + compiler->constants[i].value == v) { break; } } if (i == compiler->n_constants) { compiler->n_constants++; - compiler->constants[i].value = value; + compiler->constants[i].value = v; compiler->constants[i].alloc_reg = 0; compiler->constants[i].use_count = 0; compiler->constants[i].is_long = FALSE; -- cgit v1.2.3