mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
add flavor type check to Compiler::store
This commit is contained in:
parent
2ed52c05a8
commit
aef5acce84
@ -2598,6 +2598,8 @@ class MyCompiler: public Compiler {
|
|||||||
ir::Type dstType,
|
ir::Type dstType,
|
||||||
Operand* dst)
|
Operand* dst)
|
||||||
{
|
{
|
||||||
|
assert(&c, srcType.flavor() == static_cast<Value*>(src)->type.flavor());
|
||||||
|
// assert(&c, dstType.flavor() == static_cast<Value*>(dst)->type.flavor());
|
||||||
appendMove(&c,
|
appendMove(&c,
|
||||||
lir::Move,
|
lir::Move,
|
||||||
srcType.size(),
|
srcType.size(),
|
||||||
|
@ -3818,15 +3818,9 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
Compiler::Operand* value = frame->popInt();
|
Compiler::Operand* value = frame->popInt();
|
||||||
Compiler::Operand* address = popLongAddress(frame);
|
Compiler::Operand* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
c->store(types.address,
|
ir::Type type = MATCH(methodName(t, target), "putInt") ? types.i4
|
||||||
value,
|
: types.f4;
|
||||||
types.i4,
|
c->store(type, value, type, c->memory(address, type, 0, 0, 1));
|
||||||
c->memory(
|
|
||||||
address,
|
|
||||||
MATCH(methodName(t, target), "putInt") ? types.i4 : types.f4,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1));
|
|
||||||
return true;
|
return true;
|
||||||
} else if ((MATCH(methodName(t, target), "getLong")
|
} else if ((MATCH(methodName(t, target), "getLong")
|
||||||
and MATCH(methodSpec(t, target), "(J)J"))
|
and MATCH(methodSpec(t, target), "(J)J"))
|
||||||
@ -3854,15 +3848,9 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
Compiler::Operand* value = frame->popLong();
|
Compiler::Operand* value = frame->popLong();
|
||||||
Compiler::Operand* address = popLongAddress(frame);
|
Compiler::Operand* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
c->store(types.i8,
|
ir::Type type = MATCH(methodName(t, target), "putLong") ? types.i8
|
||||||
value,
|
: types.f8;
|
||||||
types.i8,
|
c->store(type, value, type, c->memory(address, type, 0, 0, 1));
|
||||||
c->memory(address,
|
|
||||||
MATCH(methodName(t, target), "putLong") ? types.i4
|
|
||||||
: types.f4,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1));
|
|
||||||
return true;
|
return true;
|
||||||
} else if (MATCH(methodName(t, target), "getAddress")
|
} else if (MATCH(methodName(t, target), "getAddress")
|
||||||
and MATCH(methodSpec(t, target), "(J)J"))
|
and MATCH(methodSpec(t, target), "(J)J"))
|
||||||
@ -4240,7 +4228,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case fastore:
|
case fastore:
|
||||||
c->store(types.address,
|
c->store(types.f4,
|
||||||
value,
|
value,
|
||||||
types.f4,
|
types.f4,
|
||||||
c->memory(array, types.f4, TargetArrayBody, index, 4));
|
c->memory(array, types.f4, TargetArrayBody, index, 4));
|
||||||
@ -5861,7 +5849,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
|
|
||||||
case FloatField:
|
case FloatField:
|
||||||
c->store(
|
c->store(
|
||||||
types.address,
|
types.f4,
|
||||||
value,
|
value,
|
||||||
types.f4,
|
types.f4,
|
||||||
c->memory(
|
c->memory(
|
||||||
|
Loading…
Reference in New Issue
Block a user