diff options
-rw-r--r-- | bedrock.js | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |