View Issue Details

IDProjectCategoryView StatusLast Update
0001859JEDI VCL00 JVCL Componentspublic2004-09-03 06:51
ReporterAlexeiRAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001859: JvInterpreter: AV when calling handler OnDrawItem
DescriptionI've attached application that demonstrates that exception.
It happens when calling scripted handler OnDrawItem of ListBox.
The same occurs when calling handler for TDBGrid.OnDrawColumnCell.
I think it caused by record parameter (TRect) processing.
TagsNo tags attached.

Activities

2004-06-14 04:51

 

InterpreterBugReportDrawtem.zip (3,282 bytes)

anonymous

2004-06-21 03:01

viewer   ~0004590

Even more: trying to pass any record as procedure parameter in the interpreter causes Access Violation, and trying to declare it 'var' parameter causes Stack overflow.

maxp

2004-09-03 04:29

reporter   ~0005151

At this time arrays and records as procedure/function parameters are not supported in JvInterpreter. In fact if you try to pass an array (or record) as parameter AV will always raised because memory allocated for array will be released at least twice (due to a manner by which variables passed as function parameters in JvInterpreter -- for array an array reference is copied!).

I suppose thet better way is at least inform user that passing arrays is forbidden. I attach a file "JvInterpreter_Fix.zip" in which before EnterFunction call in InFunction method procedure CheckFunParam is called:

procedure CheckFunParam;
var
  I: Integer;
begin
  for I := 0 to FCurrArgs.Count - 1 do
    if TVarData(FCurrArgs.Values[I]).VType in [varArray, varRecord] then
      NotImplemented('Array and Record types are not allowed as procedure/function parameter');
end;

This is not a real fix, of cource, but at least it prevents memory conflicts and program crash.

2004-09-03 04:30

 

JvInterpreter_Fix.zip (42,235 bytes)

AHUser

2004-09-03 06:51

developer   ~0005159

Added parameter check: Array and Records as parameters are not supported, yet.

Issue History

Date Modified Username Field Change
2004-06-14 04:51 AlexeiR New Issue
2004-06-14 04:51 AlexeiR File Added: InterpreterBugReportDrawtem.zip
2004-06-21 03:01 anonymous Note Added: 0004590
2004-09-03 04:29 maxp Note Added: 0005151
2004-09-03 04:30 maxp File Added: JvInterpreter_Fix.zip
2004-09-03 06:51 AHUser Status new => resolved
2004-09-03 06:51 AHUser Resolution open => fixed
2004-09-03 06:51 AHUser Assigned To => AHUser
2004-09-03 06:51 AHUser Note Added: 0005159