From bb7546d9f4b694b96a971e39f4d81fec0bb0610b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 10 Sep 2013 15:03:56 -0700 Subject: handle flexible arrays at the end of structs, whose elements are themselves structs; fixes #1602 --- src/runtime.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/runtime.js') diff --git a/src/runtime.js b/src/runtime.js index 33088ad9..6b1afd80 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -214,7 +214,11 @@ var Runtime = { // and it adds no size // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!'); size = 0; - alignSize = type.alignSize || QUANTUM_SIZE; + if (Types.types[field]) { + alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize); + } else { + alignSize = type.alignSize || QUANTUM_SIZE; + } } else { size = Types.types[field].flatSize; alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize); -- cgit v1.2.3-18-g5258