add type assert in Compiler::store, fix ensuing problems

This commit is contained in:
Joshua Warner 2014-05-03 20:10:55 -06:00 committed by Joshua Warner
parent e3d01746e8
commit f6bc51647e
2 changed files with 6 additions and 5 deletions

View File

@ -2595,6 +2595,7 @@ class MyCompiler: public Compiler {
virtual void store(ir::Type srcType, ir::Value* src, ir::Value* dst)
{
assert(&c, srcType == src->type);
assert(&c, srcType.flavor() == src->type.flavor());
assert(&c, srcType.flavor() == dst->type.flavor());
assert(&c,

View File

@ -3790,7 +3790,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
ir::Value* value = frame->popInt();
ir::Value* address = popLongAddress(frame);
frame->popObject();
c->store(types.address, value, c->memory(address, types.i1));
c->store(types.i4, value, c->memory(address, types.i1));
return true;
} else if ((MATCH(methodName(t, target), "getShort")
and MATCH(methodSpec(t, target), "(J)S"))
@ -3810,7 +3810,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
ir::Value* value = frame->popInt();
ir::Value* address = popLongAddress(frame);
frame->popObject();
c->store(types.address, value, c->memory(address, types.i2));
c->store(types.i4, value, c->memory(address, types.i2));
return true;
} else if ((MATCH(methodName(t, target), "getInt")
and MATCH(methodSpec(t, target), "(J)I"))
@ -4257,20 +4257,20 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
break;
case iastore:
c->store(types.address,
c->store(types.i4,
value,
c->memory(array, types.i4, TargetArrayBody, index));
break;
case bastore:
c->store(types.address,
c->store(types.i4,
value,
c->memory(array, types.i1, TargetArrayBody, index));
break;
case castore:
case sastore:
c->store(types.address,
c->store(types.i4,
value,
c->memory(array, types.i2, TargetArrayBody, index));
break;