From: SourceForge.net <no...@so...> - 2008-08-24 07:53:21
|
Patches item #2050245, was opened at 2008-08-13 22:55 Message generated for change (Settings changed) made by borutr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300599&aid=2050245&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: RvS (ervanes) >Assigned to: Borut Raem (borutr) Summary: Fix # 1963382 Initial Comment: To fix the problem I made the follwoing change: In SDCC.y : added copying of LineNo of condition ($3) to lineno of $1 As soon as the complete if-statement is parsed the creatIfx function is called to create the ast tree for the full if-statement. At that moment the lineno is 22 (the end of the if statenment). >From the 'while'-statement parsing in the .y file one can see that there the lineno is retrieved from $1->lineDef. As my knowlegde of yacc (bison) is limited, I don't know what $1 refers to, so I tried first the same construction, but $1 is not defined in the context of the IF statement. However $3 refers to the condition of the if statement which usually starts at the same line as the if, so I added that to the code. However, I am aware that it is a kind of 'best guess'. I don't know how to obtain the lineno where the if statement started from the bison environment. I did add the piece of code that was added to the bugreport as a separate bug code file for regresssion However, it is not clear to me how I can implement a useful check to prevent this error from happening again. Ruud ---------------------------------------------------------------------- >Comment By: Borut Raem (borutr) Date: 2008-08-24 09:53 Message: Logged In: YES user_id=568035 Originator: NO Patch applied in svn revision #5219. The regression test was not added since there is no way to automatically check the correctness of the .lst file. Borut ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300599&aid=2050245&group_id=599 |