- 论坛徽章:
- 0
|
作者给我回信了。原文如下:
It's been a long time since I've looked at the lcc code...!
Passing 0 as level to install is used for labels within a function, e.g., see stmtlabel in src/stmt.c. You'll see that the scope for the symbol is set to LABELS immediately after the call to install.
We pass 0 as level to ensure that a new symbol table is not allocated, because it's not need for statement labels.
Your fix will work, but it's unnecessary because the scope is set explicitly (to LABELS) in all calls to install with level equal to 0.
Good to hear you enjoy lcc and the book,
thanks,
dave hanson
看来确实有bug,不过没有必要~~~ |
|