mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
add type assert in Compiler::store, fix ensuing problems
This commit is contained in:
parent
e3d01746e8
commit
f6bc51647e
@ -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,
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user