mirror of
https://github.com/corda/corda.git
synced 2025-01-07 05:28:51 +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)
|
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() == src->type.flavor());
|
||||||
assert(&c, srcType.flavor() == dst->type.flavor());
|
assert(&c, srcType.flavor() == dst->type.flavor());
|
||||||
assert(&c,
|
assert(&c,
|
||||||
|
@ -3790,7 +3790,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
ir::Value* value = frame->popInt();
|
ir::Value* value = frame->popInt();
|
||||||
ir::Value* address = popLongAddress(frame);
|
ir::Value* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
c->store(types.address, value, c->memory(address, types.i1));
|
c->store(types.i4, value, c->memory(address, types.i1));
|
||||||
return true;
|
return true;
|
||||||
} else if ((MATCH(methodName(t, target), "getShort")
|
} else if ((MATCH(methodName(t, target), "getShort")
|
||||||
and MATCH(methodSpec(t, target), "(J)S"))
|
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* value = frame->popInt();
|
||||||
ir::Value* address = popLongAddress(frame);
|
ir::Value* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
c->store(types.address, value, c->memory(address, types.i2));
|
c->store(types.i4, value, c->memory(address, types.i2));
|
||||||
return true;
|
return true;
|
||||||
} else if ((MATCH(methodName(t, target), "getInt")
|
} else if ((MATCH(methodName(t, target), "getInt")
|
||||||
and MATCH(methodSpec(t, target), "(J)I"))
|
and MATCH(methodSpec(t, target), "(J)I"))
|
||||||
@ -4257,20 +4257,20 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case iastore:
|
case iastore:
|
||||||
c->store(types.address,
|
c->store(types.i4,
|
||||||
value,
|
value,
|
||||||
c->memory(array, types.i4, TargetArrayBody, index));
|
c->memory(array, types.i4, TargetArrayBody, index));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case bastore:
|
case bastore:
|
||||||
c->store(types.address,
|
c->store(types.i4,
|
||||||
value,
|
value,
|
||||||
c->memory(array, types.i1, TargetArrayBody, index));
|
c->memory(array, types.i1, TargetArrayBody, index));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case castore:
|
case castore:
|
||||||
case sastore:
|
case sastore:
|
||||||
c->store(types.address,
|
c->store(types.i4,
|
||||||
value,
|
value,
|
||||||
c->memory(array, types.i2, TargetArrayBody, index));
|
c->memory(array, types.i2, TargetArrayBody, index));
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user