• Didier Spezia's avatar
    cmd/asm: fix potential infinite loop in parser · 7437e3f0
    Didier Spezia authored
    For ARM machines, the assembler supports list of registers
    operands such as [R1,R2].
    
    A list missing a ']' results in the parser issuing many errors
    and consuming all the tokens. At EOF (i.e. end of the line),
    it still loops.
    
    Normally, a counter is maintained to make sure the parser
    stops after 10 errors. However, multiple errors occuring on the
    same line are simply ignored. Only the first one is reported.
    At most one error per line is accounted.
    
    Missing ']' in a register list therefore results in an
    infinite loop.
    
    Fixed the parser by explicitly checking for ']' to interrupt
    this loops
    
    In the operand tests, also fixed a wrong entry which I think was
    not set on purpose (but still led to a successful result).
    
    Fixes #11764
    
    Change-Id: Ie87773388ee0d21b3a2a4cb941d4d911d0230ba4
    Reviewed-on: https://go-review.googlesource.com/13920Reviewed-by: 's avatarRob Pike <r@golang.org>
    7437e3f0
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...