aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-02 15:22:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:05 -0700
commit5beb8daae49c7ef9232a658c3158ebe0d565489c (patch)
tree00debc119ca0b81720df0680c40493f1f03d08f7 /tools/js-optimizer.js
parentaebf1a7ba53cc744fe69f209126aea37b4eca1c7 (diff)
do not relocate function pointers when no need to (no such table in parent)
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 2c0a2b88..1de06e4c 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -2759,10 +2759,11 @@ function relocate(ast) {
if (node[2][1] == 'H_BASE') {
base = hBase;
} else if (m = /^F_BASE_(\w+)$/.exec(node[2][1])) {
- base = fBases[m[1]];
+ base = fBases[m[1]] || 0; // 0 if the parent has no function table for this, but the child does. so no relocation needed
}
if (base !== null) {
var other = node[3];
+ if (base === 0) return other;
if (other[0] == 'num') {
other[1] += base;
return other;