3 ms·
I think it’s a code improvement, too. It now computes the new flags in one place. Just looking at these lines, I don’t understand the code, though. Apparently,
by Someone 6y ago
I think it’s a code improvement, too. It now computes the new flags in one place.
Just looking at these lines, I don’t understand the code, though. Apparently, sqlite3VdbeMemRelease can change pMem->flags, but that change can be ignored. I can’t think of a simple explanation for that.
Also, the function name sqlite3VdbeMemRelease seems to indicate memory gets released, but pMem->flags = MEM_Str|MEM_Term…, to me, indicates it contains a string.
- jfkebwjsbx 6y agoPerhaps, but the justification behind the change should be that one, not the miscompilation...
- dathinab 6y ago> but that change can be ignore No the changes _must_ be ignored. This is where the bug came from. The code does store the flags, does an operation and then restores some flags while setting some new ones. But after clang reorders the operations it will not restore the flags from _before_ the function calls but instead takes them from _after_ the function call. I.e. any change `sqlite3VdbeMemRelease` does to `pMem` mutst be ignored but after reordering changes to `MEM_AffMask` `MEM_Subtype` are no longer ignored.
- shawnz 6y agoI think what they are saying is, why does sqlite3VdbeMemRelease change the flags in the first place if the change must be ignored?