restrict number parsing to current base
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Sun, 6 Jun 2021 07:06:52 +0000 (17:06 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Sun, 6 Jun 2021 07:06:52 +0000 (17:06 +1000)
compile.asm

index 72a8763375abfa406e77a9816f1df9cd66d723ed..defb1acaa5dcfc25e59eac9acbe315c216b5c450 100644 (file)
@@ -193,6 +193,8 @@ p_number_ALPHA:
        cmp al,'Z'
        jg p_number_alpha
        sub al,'A'-10
+       cmp rax,qword [p_base_DFA]
+       jge p_number_BAD
        jmp p_number_CONSUME
 p_number_alpha:
        cmp al,'a'
@@ -200,6 +202,8 @@ p_number_alpha:
        cmp al,'z'
        jg p_number_BAD
        sub al,'a'-10
+       cmp rax,qword [p_base_DFA]
+       jge p_number_BAD
        jmp p_number_CONSUME
 p_number_BAD:
        push qword 0