aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Pesch <inolen@gmail.com>2013-07-01 16:45:37 -0700
committerAnthony Pesch <inolen@gmail.com>2013-07-01 17:06:01 -0700
commitf1d7b1bed51f9c1023fbc09dd43b5fc71cfc4008 (patch)
treeadc739b4ae8f7519802fb46110e2fefe41fd015f
parent01708b7529bc4305272277c38c8f6c91ad27e367 (diff)
assert on bad pointer in Pointer_stringify
-rw-r--r--src/preamble.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 4c61a86e..55a8a3a5 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -525,6 +525,9 @@ function Pointer_stringify(ptr, /* optional */ length) {
var t;
var i = 0;
while (1) {
+#if ASSERTIONS
+ assert(ptr + i < TOTAL_MEMORY);
+#endif
t = {{{ makeGetValue('ptr', 'i', 'i8', 0, 1) }}};
if (t >= 128) hasUtf = true;
else if (t == 0 && !length) break;