aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 4af7cbc5..4582f0b1 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -257,13 +257,15 @@ function analyzer(data) {
// Decision time
+ var pointedType = removePointing(variable.type);
if (variable.origin == 'getelementptr') {
// Use our implementation that emulates pointers etc.
variable.impl = VAR_EMULATED;
} else if (OPTIMIZE && variable.pointingLevels === 0 && !variable.hasAddrTaken) {
// A simple int value, can be implemented as a native variable
variable.impl = VAR_NATIVE;
- } else if (OPTIMIZE && variable.origin === 'alloca' && !variable.hasAddrTaken && !variable.hasValueTaken) {
+ } else if (OPTIMIZE && variable.origin === 'alloca' && !variable.hasAddrTaken && !variable.hasValueTaken &&
+ (Runtime.isNumberType(pointedType) || Runtime.isPointerType(pointedType))) {
// A pointer to a value which is only accessible through this pointer. Basically
// a local value on the stack, which nothing fancy is done on. So we can
// optimize away the pointing altogether, and just have a native variable