issue-#16: TRAP in DevAnalyzer.UseObj
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
issue-#16: TRAP in DevAnalyzer.UseObj
Let's discuss the alternative solutions and vote for including this bug fix?
http://redmine.blackboxframework.org/issues/7
http://redmine.blackboxframework.org/issues/7
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: #7 TRAP in DevAnalyzer.UseObj
Can you please, evaluate my solution of this bug?
-
- Posts: 204
- Joined: Wed Sep 18, 2013 10:06 pm
- Contact:
Re: #7 TRAP in DevAnalyzer.UseObj
The example provided is true garbage code. The fact that the analyser traps on it does not surprise or concern me greatly - if it does happen it might be a good incentive for the programmer to take more care in future. If it only traps on the sort of example provided I would hope that it occurs in real-life extremely rarely.
However, if you believe it is worthy of more attention, please provide a description of the precise nature / scope of the problem, what alternative solutions there are and why you prefer your proposed solution.
However, if you believe it is worthy of more attention, please provide a description of the precise nature / scope of the problem, what alternative solutions there are and why you prefer your proposed solution.
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: #7 TRAP in DevAnalyzer.UseObj
I had catch this error when I forgot to change index number and run Analyzer. You are right that it is good indicator if something wrong. However the language report does not prohibit such code and compiler do it well. Analyzer can indicate this, but not with TRAP. I will think about alternative fix with warning message for user.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: #7 TRAP in DevAnalyzer.UseObj
This bug needs to be analyzed more carefully.
The fix proposed by Ivan does not solve all problems.
Look for example at the following test case:
There is a tricky encoding of obj.num being used for nested FOR loops.
We must understand that trick first before we can solve the problem.
- Josef
The fix proposed by Ivan does not solve all problems.
Look for example at the following test case:
Code: Select all
FOR i := 0 TO 100 DO
FOR i := 0 TO 100 DO
FOR i := 0 TO 100 DO
b := i
END;
b := i
END
END
We must understand that trick first before we can solve the problem.
- Josef
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: #7 TRAP in DevAnalyzer.UseObj
A similar bug fix must also be applied in SetObj and it
may be slightly simplified in UseObj as outlined below.
- Josef
may be slightly simplified in UseObj as outlined below.
Code: Select all
| set: obj.num := setUsed
ELSE (* already marked as being used *)
END
END
END UseObj;
Code: Select all
| set: IF varPar THEN obj.num := setUsed END
ELSE DumpObj(obj); err2(loopVarSet, pos) (* for loop variable gets set!*)
END
END
END SetObj;
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: #7 TRAP in DevAnalyzer.UseObj
I have just seen that this bug is already covered by the CPC 1.7 change list
as number 44. The proposed fix in CPC 1.7 does not include the above
simplification and suppresses errors in SetObj for deeper nesting levels
because it uses an empty ELSE branch.
So, I believe that the above proposal is superior.
I have created issue #16 in redmine for it and I have created a topic branch
issue-#16 with the above changes.
- Josef
as number 44. The proposed fix in CPC 1.7 does not include the above
simplification and suppresses errors in SetObj for deeper nesting levels
because it uses an empty ELSE branch.
So, I believe that the above proposal is superior.
I have created issue #16 in redmine for it and I have created a topic branch
issue-#16 with the above changes.
- Josef
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: #7 → #16 TRAP in DevAnalyzer.UseObj
Josef and Helmut, thank you for this work!
It works perfect: For all members, you can try this here:
http://blackboxframework.org/unstable/i ... a1.010.zip
The differences in sources you can see following this link:
http://redmine.blackboxframework.org/pr ... 91b914d590
I think, that we can vote for including this in Center version? Or we need some further discussion?
It works perfect: For all members, you can try this here:
http://blackboxframework.org/unstable/i ... a1.010.zip
The differences in sources you can see following this link:
http://redmine.blackboxframework.org/pr ... 91b914d590
I think, that we can vote for including this in Center version? Or we need some further discussion?
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: #7 → #16 TRAP in DevAnalyzer.UseObj
I just have a question about issue priority.
Are we chipping away at issues stated by Helmut/OberonCore or do we have a
systematic program for incorporating them in our next version?
Our #16 looks like we have cherry picked one of their issues (44).
-Doug
Are we chipping away at issues stated by Helmut/OberonCore or do we have a
systematic program for incorporating them in our next version?
Our #16 looks like we have cherry picked one of their issues (44).
-Doug
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: #7 → #16 TRAP in DevAnalyzer.UseObj
The issues I have entered so far in the issue tracker are all related in some sense withDGDanforth wrote:I just have a question about issue priority.
Are we chipping away at issues stated by Helmut/OberonCore or do we have a
systematic program for incorporating them in our next version?
Our #16 looks like we have cherry picked one of their issues (44).
-Doug
the automated build process (#14). The DevAnalyzer bug is a bit out of order in that sense.
However, as long as there are no merge conflicts to expect, I don't really mind about the order.
When we are eventually going to attack the Unicode in CP identifiers issue,
we must be careful not to introduce a lot of merge conflicts with other topics.
Therefore the Unicode issue MUST be the only one to be worked on until it is merged to master.
Manual merges are not only tedious but also a potential source of errors.
- Josef