Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006241 [JEDI VCL] Donation crash always 2013-12-23 16:27 2016-08-04 21:18
Reporter CubicDesign View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Version 2.4
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.
Attached Files

- Relationships
has duplicate 0006436resolvedAHUser Crash in JvPaintFX.pas 

-  Notes
(0021031)
obones (administrator)
2014-09-03 11:37

Please provide the zipped sources of a sample application showing this
(0021220)
AHUser (developer)
2015-09-27 16:42

The $R- is in the jedi.inc, so it is still there.
(0021225)
CubicDesign (reporter)
2015-09-28 11:29

I did a search for '$R' in jedi.inc but cannot find it
(0021226)
CubicDesign (reporter)
2015-09-28 11:29

Is this the file?

\jcl\source\include\jedi\jedi.inc
(0021227)
CubicDesign (reporter)
2015-09-28 11:34

Sorry... found it as: {$IFOPT R+} {$DEFINE RANGECHECKS_ON} {$ENDIF}
(0021228)
CubicDesign (reporter)
2015-09-28 11:38

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.
(0021229)
AHUser (developer)
2015-09-28 15:29

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.
(0021334)
AHUser (developer)
2016-08-04 21:18

Fixed in master branch

- Issue History
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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker