summaryrefslogtreecommitdiff
path: root/bedrock.js
diff options
context:
space:
mode:
Diffstat (limited to 'bedrock.js')
-rw-r--r--bedrock.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/bedrock.js b/bedrock.js
index 99d2319..1b47b63 100644
--- a/bedrock.js
+++ b/bedrock.js
@@ -405,7 +405,9 @@ function EmulatorElement(options) {
emulator.updateStatePanel = function() {
function renderStack(stack) {
let string = '';
- for (let i=0; i<stack.p; i++) string += hex(stack.mem[i], 2) + ' ';
+ for (let i=0; i<stack.p && i<stack.mem.length; i++) {
+ string += hex(stack.mem[i], 2) + ' ';
+ }
return string;
}
pcState.textContent = hex(br.p, 4);