From 99f069f03c4d34824bf1af5bc2eb3fd3a608f5de Mon Sep 17 00:00:00 2001
From: Recolic Keghart <root@recolic.net>
Date: Sun, 15 Dec 2019 03:48:03 +0800
Subject: [PATCH] >  Manual commit:  Bug fix for lexer, '%eax' off-by-1 error
 U201614531 recolic Linux RECOLICPC 5.4.2-arch1-1 #1 SMP PREEMPT Thu, 05 Dec
 2019 12:29:40 +0000 x86_64 GNU/Linux  03:48:03 up 3 days, 11:06,  1 user, 
 load average: 0.30, 0.46, 0.91 308942fa767af1bf582c0816fcd66d09f9cfeea3

---
 nemu/src/monitor/debug/expr_impl/lexer.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nemu/src/monitor/debug/expr_impl/lexer.l b/nemu/src/monitor/debug/expr_impl/lexer.l
index 7da3a97..f1cfff1 100644
--- a/nemu/src/monitor/debug/expr_impl/lexer.l
+++ b/nemu/src/monitor/debug/expr_impl/lexer.l
@@ -19,6 +19,6 @@
 "&&"          {return T_LOGICAL_AND;}
 [-+*/()]      {return yytext[0];}
 
-"%"[a-z]{3}   {yylval.ival = ((uint32_t)yytext[1] << 8) + yytext[2]; return T_REG;}
+"%"[a-z]{3}   {yylval.ival = ((uint32_t)yytext[2] << 8) + yytext[3]; return T_REG;}
 %%
 // Registers: eax='a'+'x', ebx='b'+'x', ...
-- 
GitLab