Bug 199 - Tokeniser is fully running inside a disabled code block, can cause problems
Summary: Tokeniser is fully running inside a disabled code block, can cause problems
Status: RESOLVED FIXED
Alias: None
Product: RMAC
Classification: Unclassified
Component: Core (show other bugs)
Version: unspecified
Hardware: PC Linux
: Normal enhancement
Assignee: Shamus Hammons
URL:
Depends on:
Blocks:
 
Reported: 2022-04-17 02:20 CDT by ggn
Modified: 2022-12-21 16:08 CST (History)
1 user (show)

See Also:


Attachments
The patches! (870 bytes, patch)
2022-12-20 13:43 CST, ggn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ggn 2022-04-17 02:20:58 CDT
Check out comment 3 here for an example: http://jlhconsulting.gotdns.com/bugs/show_bug.cgi?id=193#c3

IMO when code is disabled, we should only scan for an '.endif' token and discard anything else.
Comment 1 ggn 2022-12-20 13:43:49 CST
Created attachment 204 [details]
The patches!
Comment 2 ggn 2022-12-20 13:44:35 CST
Ok, here's one way of fixing this (attached patch). Basically we stop processing inside the tokeniser and a disabled block after the first symbol has been recorded.

Not sure if that's 100% robust, but at least it doesn't break anything, and it should be good enough for pretty much all cases. The assumption here is that the disabled block will end with a single line that just has ".endif".

So, unless there are objections I think this is good to go!
Comment 3 Shamus Hammons 2022-12-21 16:08:47 CST
The problem came in where if there were errors in your code in the .if zeroed section, it would cause the assembler to error out.  I'm not 100% convinced this will catch all those cases, but it's too good of a hack to not use.

Just something to keep in mind.  ;-)