aboutsummaryrefslogtreecommitdiffgithub
path: root/novice/simulator/cli-debugger.ts
diff options
context:
space:
mode:
authorAustin Adams <git@austinjadams.com>2019-02-05 23:00:58 -0500
committerAustin Adams <git@austinjadams.com>2019-02-05 23:00:58 -0500
commita1cf7626f6971c1f80a8511608ee5c701de2ccb4 (patch)
treef851e61dacff0fe311d0418ec8ffb6f857fdc891 /novice/simulator/cli-debugger.ts
parent699bb01c1d7036bae89423cc4d5b24552cec6fbe (diff)
downloadnovice-a1cf7626f6971c1f80a8511608ee5c701de2ccb4.tar.gz
novice-a1cf7626f6971c1f80a8511608ee5c701de2ccb4.tar.xz
Try to optimize symbol lookups in debuggerHEADmaster
Diffstat (limited to 'novice/simulator/cli-debugger.ts')
-rw-r--r--novice/simulator/cli-debugger.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/novice/simulator/cli-debugger.ts b/novice/simulator/cli-debugger.ts
index 6a8e8d5..b40d517 100644
--- a/novice/simulator/cli-debugger.ts
+++ b/novice/simulator/cli-debugger.ts
@@ -178,10 +178,10 @@ class CliDebugger extends Debugger {
/\d+/.test(operand) ? 10 : -1;
let addr: number;
if (base === -1) {
- if (!(operand in this.symbTable)) {
+ if (!this.hasSymbol(operand)) {
throw new Error(`unknown label \`${operand}'`);
}
- addr = this.symbTable[operand];
+ addr = this.getSymbolAddr(operand);
} else {
addr = parseInt(operand, base);
}