View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001893 | JEDI VCL | 00 JVCL Components | public | 2004-06-25 06:53 | 2004-08-30 17:26 |
Reporter | AlexeiR | Assigned To | AHUser | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0001893: JvInterpreter: wrong types in var parameters. | ||||
Description | I have used a procedure DecodeDate in my script, and it appeared to return a wrong value of Year (=212). I have traced a procedure JvInterpreter_DecodeDate (unit jvInterpreter_SysUtils). The type of variant Args.Values[1] is 'byte' instead of 'word' or 'smallint', so value of year is truncated. 2004=$O7D4, 212=$D4. I couldn't fix this bug in the interpreter, but a workaround is to use the following version of wrapper procedure: procedure JvInterpreter_DecodeDate(var Value: Variant; Args: TJvInterpreterArgs); var Year: word; begin DecodeDate(Args.Values[0], Year, Word(TVarData(Args.Values[2]).vSmallint), Word(TVarData(Args.Values[3]).vSmallint)); Args.Values[1] := Year; end; I thought that the problem is in the function Typ2Size, in which the occurs: ... varSmallInt: Result := SizeOf(varSmallInt); ... i.e. Result=1 instead of 2. but it's not called in my example. It seems to me it should look as ... varSmallInt: Result := SizeOf(SmallInt); ... | ||||
Additional Information | I have also attached application that demonstrates this bug. | ||||
Tags | No tags attached. | ||||
2004-06-25 06:53
|
JvInterpreter_Bug_DecodeDate.zip (3,152 bytes) |
|
I cannot reproduce this bug (using JVCL3-Source-2004-08-17.zip sources). Running example from JvInterpreter_Bug_DecodeDate.zip always give answer 'Year = 2004'. But piece of code quoted by AlexeiR ... varSmallInt: Result := SizeOf(varSmallInt); ... indeed looks strange. Can anyone check if it is correct??? From the logic of the whole procedure Typ2Size it seems that there should be ... varSmallInt: Result := SizeOf(SmallInt); .... |
|
Fixed in CVS. |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-06-25 06:53 | AlexeiR | New Issue | |
2004-06-25 06:53 | AlexeiR | File Added: JvInterpreter_Bug_DecodeDate.zip | |
2004-08-21 01:26 | maxp | Note Added: 0005060 | |
2004-08-30 17:26 | AHUser | Status | new => resolved |
2004-08-30 17:26 | AHUser | Resolution | open => fixed |
2004-08-30 17:26 | AHUser | Assigned To | => AHUser |
2004-08-30 17:26 | AHUser | Note Added: 0005113 |