mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
avoid crash when parsing certain abstract classes which declare no methods
This commit is contained in:
parent
0aa5755187
commit
929315e1f2
@ -1673,13 +1673,17 @@ parseMethodTable(Thread* t, Stream& s, object class_, object pool)
|
|||||||
set(t, addendum, ClassAddendumMethodTable,
|
set(t, addendum, ClassAddendumMethodTable,
|
||||||
classMethodTable(t, class_));
|
classMethodTable(t, class_));
|
||||||
|
|
||||||
unsigned oldLength = arrayLength(t, classMethodTable(t, class_));
|
unsigned oldLength = classMethodTable(t, class_) ?
|
||||||
|
arrayLength(t, classMethodTable(t, class_)) : 0;
|
||||||
|
|
||||||
object newMethodTable = makeArray
|
object newMethodTable = makeArray
|
||||||
(t, oldLength + listSize(t, abstractVirtuals));
|
(t, oldLength + listSize(t, abstractVirtuals));
|
||||||
|
|
||||||
memcpy(&arrayBody(t, newMethodTable, 0),
|
if (oldLength) {
|
||||||
&arrayBody(t, classMethodTable(t, class_), 0),
|
memcpy(&arrayBody(t, newMethodTable, 0),
|
||||||
oldLength * sizeof(object));
|
&arrayBody(t, classMethodTable(t, class_), 0),
|
||||||
|
oldLength * sizeof(object));
|
||||||
|
}
|
||||||
|
|
||||||
mark(t, newMethodTable, ArrayBody, oldLength);
|
mark(t, newMethodTable, ArrayBody, oldLength);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user