Fixing divdu by constant -1.

This commit is contained in:
Ben Vanik
2015-05-12 23:09:32 -07:00
parent e7b03042ba
commit 56bd2eee2e
14 changed files with 383 additions and 141 deletions

View File

@@ -308,16 +308,16 @@ void Value::Div(Value* other) {
assert_true(type == other->type);
switch (type) {
case INT8_TYPE:
constant.i8 /= other->constant.i8;
constant.i8 /= uint8_t(other->constant.i8);
break;
case INT16_TYPE:
constant.i16 /= other->constant.i16;
constant.i16 /= uint16_t(other->constant.i16);
break;
case INT32_TYPE:
constant.i32 /= other->constant.i32;
constant.i32 /= uint32_t(other->constant.i32);
break;
case INT64_TYPE:
constant.i64 /= other->constant.i64;
constant.i64 /= uint64_t(other->constant.i64);
break;
case FLOAT32_TYPE:
constant.f32 /= other->constant.f32;