renan-guimaraes / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Internal assertion exception #377

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a TdwsUnit, which defines a record with 1 integer field and 4 boolean 
fields. A function in this unit uses the record as a return value type. The 
function assigns "Lo(WordVariable)" to the integer field.

When running a script that tries to use the integer field of the function 
result, an assertion exception occurs on line 363 of dwsStack.pas in 
ReadIntValue_BaseRelative, which is "Assert(varData.VType=varInt64);". The type 
of the variant seems to be varWord.

I have not been able to reproduce this in a simple sample project, as even this 
exact unit does not display the same behavior in a separate project.

NOTE: Casting the result of Lo to an Int64 before assigning it to the field in 
the result, does resolve the issue.

Original issue reported on code.google.com by frederic...@gmail.com on 22 Apr 2013 at 4:35

GoogleCodeExporter commented 9 years ago
NOTE2: Assigning to ValueAsInteger, rather than Value also solves the issue as 
this is the same as casting to Int64.

Original comment by frederic...@gmail.com on 22 Apr 2013 at 4:37

GoogleCodeExporter commented 9 years ago
Committed a possible fix, whet you using .Value rather than .ValueAsInteger to 
set the value?

Original comment by zar...@gmail.com on 25 Apr 2013 at 6:30

GoogleCodeExporter commented 9 years ago
The fix seems to work, thank you.

Original comment by frederic...@gmail.com on 25 Apr 2013 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by zar...@gmail.com on 25 Apr 2013 at 11:46