You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
overload: Allow passing constant 0 Byte/Short to pointer params
This makes the behaviour of normal and overloaded calls match.
ast-node-conv allows assigning a literal zero integer to a pointer even if
the integer type's size didn't match the pointer size. hCalcTypesDiff() on
the other hand had a check only allowing this if the type size matched.
To fix this, the non-ptr-to-ptr checking code from ast-node-conv.bas is
extracted into a helper function which is now called by hCalcTypesDiff(),
replacing the bogus size check. This should ensure that both overload
resolution and normal cast/conv checks will behave the same (as far as
passing literal zeroes to pointers is concerned).
This also fixes the issue where it was no longer possible to call Bsave
in -lang qb with 0 as the 2nd parameter (which is a pointer), since commit
07d6977 in FB 0.90 which turned Bsave() into an overloaded function.
Copy file name to clipboardExpand all lines: changelog.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,7 @@ Version 1.01.0
59
59
- PRINT now disallows commas/newlines after SPC/TAB, instead of silently ignoring them
60
60
- 0.90.0 regression: Compiler crash during error recovery for expressions like 'type<UDT>().field' where initializer values are missing
61
61
- When passing a constant zero of some integer to an overloaded procedure, overloads with integer parameters will now be preferred over overloads with pointers (literal 0 can still be passed to pointer parameters in this case though, by casting it to the pointer type)
62
+
- Literal zeroes with [U]Byte or [U]Short type (or the 16bit Integer in -lang qb) can now be passed to pointer parameters of overloaded procedures (now it's possible to call Bsave() with 0 source buffer in -lang qb again -- it also was affected by this bug since FB 0.90)
0 commit comments