Fixes a memory corruption when loading classes that inherit static
fields.
Signed-off-by: Vegard Nossum <[email protected]>
---
vm/class.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vm/class.c b/vm/class.c
index ec76c69..eaacbda 100644
--- a/vm/class.c
+++ b/vm/class.c
@@ -194,7 +194,7 @@ int vm_class_link(struct vm_class *vmc, const struct
cafebabe_class *class)
}
/* XXX: only static fields, right size, etc. */
- vmc->static_values = malloc(class->fields_count * 8);
+ vmc->static_values = malloc(static_offset + class->fields_count * 8);
for (uint16_t i = 0; i < class->fields_count; ++i) {
struct vm_field *vmf = &vmc->fields[i];
--
1.6.0.4
------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel