View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006241 | JEDI VCL | Donation | public | 2013-12-23 16:27 | 2016-08-04 21:18 |
Reporter | CubicDesign | Assigned To | AHUser | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | Daily / GIT | |||
Summary | 0006241: Range check error in JvPaintFX.pas | ||||
Description | There is a problem with the code donated by Jan (JvPaintFX.pas). In the original code there was a {$R-} directive. After the code was donated somebody removed that directive and now 'procedure Stretch' fails with a 'Range check error'. That {$R-} was supposed to be there. The code is pre-Delphi 4 and it uses some some nasty trick to get the job done. This article (see post by Rob Kenedy) explains why the $R- must be there!!! http://stackoverflow.com/questions/628965/delphi-accessing-data-from-dynamic-array-that-is-populated-from-an-untyped-poi | ||||
Additional Information | The code is really really bad. Needs massive improvement. Things like this: TCListList = array[0..0] of TCList; PCListList = ^TCListList; must be replaced with 'normal' arrays. This will make the nasty GemMem go away and SetLength will be used instead. Also, things like this can be improved for speed: RGB.R := 0; RGB.G := 0; RGB.B := 0; ___________________ | ||||
Tags | No tags attached. | ||||
|
Please provide the zipped sources of a sample application showing this |
|
The $R- is in the jedi.inc, so it is still there. |
|
I did a search for '$R' in jedi.inc but cannot find it |
|
Is this the file? \jcl\source\include\jedi\jedi.inc |
|
Sorry... found it as: {$IFOPT R+} {$DEFINE RANGECHECKS_ON} {$ENDIF} |
|
This means that Jedi library was never ran with $R+ ? $R+ helps the programmer discover bugs. But in this case, if you activate RangeChecking, then the code in JvPaintFX will fail. RangeChecking need to be locally disabled in that file, as it was in the original JanFX file. |
|
It's in the jvcl.inc the line "{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}" The JVCL never used $R+. Sure it would be nice to check for range errors but enabling it for the JVCL would require a lot of code to be changed and there aren't enough developers left for this. |
|
Fixed in master branch |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-12-23 16:27 | CubicDesign | New Issue | |
2013-12-23 16:27 | CubicDesign | IDE version | => Delphi/C++Builder XE |
2014-05-17 17:26 | AHUser | Project | JEDI Code Library => JEDI VCL |
2014-09-03 11:37 | obones | Note Added: 0021031 | |
2014-09-03 11:37 | obones | Status | new => feedback |
2015-09-27 16:42 | AHUser | Note Added: 0021220 | |
2015-09-28 11:29 | CubicDesign | Note Added: 0021225 | |
2015-09-28 11:29 | CubicDesign | Note Added: 0021226 | |
2015-09-28 11:34 | CubicDesign | Note Added: 0021227 | |
2015-09-28 11:38 | CubicDesign | Note Added: 0021228 | |
2015-09-28 15:29 | AHUser | Note Added: 0021229 | |
2016-08-04 21:17 | AHUser | Relationship added | has duplicate 0006436 |
2016-08-04 21:18 | AHUser | Note Added: 0021334 | |
2016-08-04 21:18 | AHUser | Status | feedback => resolved |
2016-08-04 21:18 | AHUser | Fixed in Version | => Daily / GIT |
2016-08-04 21:18 | AHUser | Resolution | open => fixed |
2016-08-04 21:18 | AHUser | Assigned To | => AHUser |