- Notifications
You must be signed in to change notification settings - Fork5
Commitb1dd2f8
committed
Convert contrib/seg's bool-returning SQL functions to V1 call convention.
It appears that we can no longer get away with using V0 call conventionfor bool-returning functions in newer versions of MSVC. The compilerseems to generate code that doesn't clear the higher-order bits of theresult register, causing the bool result Datum to often read as "true"when "false" was intended. This is not very surprising, since thefunction thinks it's returning a bool-width result but fmgr_oldstyleassumes that V0 functions return "char *"; what's surprising is thatthat hack worked for so long on so many platforms.The only functions of this description in core+contrib are in contrib/seg,which we'd intentionally left mostly in V0 style to serve as a warningcanary if V0 call convention breaks. We could imagine hacking thingsso that they're still V0 (we'd have to redeclare the bool-returningfunctions as returning some suitably wide integer type, like size_t,at the C level). But on the whole it seems better to convert 'em to V1.We can still leave the pointer- and int-returning functions in V0 style,so that the test coverage isn't gone entirely.Back-patch to 9.5, since our intention is to support VS2015 in 9.5and later. There's no SQL-level change in the functions' behaviorso back-patching should be safe enough.Discussion: <22094.1461273324@sss.pgh.pa.us>Michael Paquier, adjusted some by me1 parent409c49c commitb1dd2f8
1 file changed
+195
-105
lines changed0 commit comments
Comments
(0)