View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001859 | JEDI VCL | 00 JVCL Components | public | 2004-06-14 04:51 | 2004-09-03 06:51 |
Reporter | AlexeiR | Assigned To | AHUser | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0001859: JvInterpreter: AV when calling handler OnDrawItem | ||||
Description | I'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. | ||||
Tags | No tags attached. | ||||
2004-06-14 04:51
|
InterpreterBugReportDrawtem.zip (3,282 bytes) |
|
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. |
|
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) |
|
Added parameter check: Array and Records as parameters are not supported, yet. |
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 |