mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19: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,
|
||||
classMethodTable(t, class_));
|
||||
|
||||
unsigned oldLength = arrayLength(t, classMethodTable(t, class_));
|
||||
unsigned oldLength = classMethodTable(t, class_) ?
|
||||
arrayLength(t, classMethodTable(t, class_)) : 0;
|
||||
|
||||
object newMethodTable = makeArray
|
||||
(t, oldLength + listSize(t, abstractVirtuals));
|
||||
|
||||
memcpy(&arrayBody(t, newMethodTable, 0),
|
||||
&arrayBody(t, classMethodTable(t, class_), 0),
|
||||
oldLength * sizeof(object));
|
||||
if (oldLength) {
|
||||
memcpy(&arrayBody(t, newMethodTable, 0),
|
||||
&arrayBody(t, classMethodTable(t, class_), 0),
|
||||
oldLength * sizeof(object));
|
||||
}
|
||||
|
||||
mark(t, newMethodTable, ArrayBody, oldLength);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user