aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parseTools.js8
-rw-r--r--src/runtime.js4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index dae386f1..223adbbf 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1009,11 +1009,9 @@ function getOldLabel(label) {
}
function calcAllocatedSize(type) {
- if (pointingLevels(type) == 0 && isStructType(type)) {
- return Types.types[type].flatSize; // makeEmptyStruct(item.allocatedType).length;
- } else {
- return Runtime.getNativeTypeSize(type); // We can really get away with '1', though, at least on the stack...
- }
+ var ret = Runtime.getNativeTypeSize(type);
+ if (ret) return ret;
+ return Types.types[type].flatSize; // known type
}
// Generates the type signature for a structure, for each byte, the type that is there.
diff --git a/src/runtime.js b/src/runtime.js
index 5d5cb43b..ca2304da 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -145,7 +145,7 @@ var Runtime = {
//! @param type The type, by name.
getNativeTypeSize: function(type) {
#if QUANTUM_SIZE == 1
- return 1;
+ return 1;
#else
switch (type) {
case 'i1': case 'i8': return 1;
@@ -161,6 +161,8 @@ var Runtime = {
var bits = parseInt(type.substr(1));
assert(bits % 8 === 0);
return bits/8;
+ } else {
+ return 0;
}
}
}