mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
throw an error if a volatile field is encountered, since we don't yet support them properly
This commit is contained in:
parent
c479bccdb4
commit
5e727c8c5d
@ -2483,6 +2483,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
||||
|
||||
object field = resolveField(t, codePool(t, code), index - 1);
|
||||
if (UNLIKELY(t->exception)) return;
|
||||
if (throwIfVolatileField(t, field)) return;
|
||||
|
||||
Compiler::Operand* table;
|
||||
|
||||
@ -3363,6 +3364,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
||||
|
||||
object field = resolveField(t, codePool(t, code), index - 1);
|
||||
if (UNLIKELY(t->exception)) return;
|
||||
if (throwIfVolatileField(t, field)) return;
|
||||
|
||||
object staticTable = 0;
|
||||
|
||||
|
@ -1452,6 +1452,7 @@ interpret(Thread* t)
|
||||
|
||||
object field = resolveField(t, codePool(t, code), index - 1);
|
||||
if (UNLIKELY(exception)) goto throw_;
|
||||
if (throwIfVolatileField(t, field)) goto throw_;
|
||||
|
||||
pushField(t, popObject(t), field);
|
||||
} else {
|
||||
@ -1465,6 +1466,8 @@ interpret(Thread* t)
|
||||
|
||||
object field = resolveField(t, codePool(t, code), index - 1);
|
||||
if (UNLIKELY(exception)) goto throw_;
|
||||
if (throwIfVolatileField(t, field)) goto throw_;
|
||||
|
||||
PROTECT(t, field);
|
||||
|
||||
if (UNLIKELY(classInit(t, fieldClass(t, field), 3))) goto invoke;
|
||||
@ -2396,6 +2399,7 @@ interpret(Thread* t)
|
||||
|
||||
object field = resolveField(t, codePool(t, code), index - 1);
|
||||
if (UNLIKELY(exception)) goto throw_;
|
||||
if (throwIfVolatileField(t, field)) goto throw_;
|
||||
|
||||
switch (fieldCode(t, field)) {
|
||||
case ByteField:
|
||||
@ -2461,6 +2465,8 @@ interpret(Thread* t)
|
||||
|
||||
object field = resolveField(t, codePool(t, code), index - 1);
|
||||
if (UNLIKELY(exception)) goto throw_;
|
||||
if (throwIfVolatileField(t, field)) goto throw_;
|
||||
|
||||
PROTECT(t, field);
|
||||
|
||||
if (UNLIKELY(classInit(t, fieldClass(t, field), 3))) goto invoke;
|
||||
|
@ -188,6 +188,21 @@ populateMultiArray(Thread* t, object array, int32_t* counts,
|
||||
int
|
||||
findLineNumber(Thread* t, object method, unsigned ip);
|
||||
|
||||
inline bool
|
||||
throwIfVolatileField(Thread* t, object field)
|
||||
{
|
||||
if (fieldFlags(t, field) & ACC_VOLATILE) {
|
||||
object message = makeString
|
||||
(t, "volatile fields are not yet supported: %s.%s",
|
||||
&byteArrayBody(t, className(t, fieldClass(t, field)), 0),
|
||||
&byteArrayBody(t, fieldName(t, field), 0));
|
||||
t->exception = makeNoSuchFieldError(t, message);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace vm
|
||||
|
||||
#endif//PROCESS_H
|
||||
|
Loading…
Reference in New Issue
Block a user