Hello,

On 2017-04-19 19:31, Dan Kennedy wrote:

If you compile the code below with gcc 7.0.1:

   gcc code.c -fsantitize=address -o tst

and then run:

  ./tst 2

Does the sanitizer make the same complaint?

[...]

/**********************************************/
[...]
   switch( a ){
     case 1: {
       int res;
       b = 1;

     case 2:
       res = b;
       c = res;
       break;
     }
   }
[...]
/**********************************************/
IMHO, ``res'' will not be even protruded to the sanitizer. ``vdbe.c''s code is using a pointer to ``res'', passing it as a parameter -- thus SQLite's ``res'' is handled by use-after-scope sanitizer, while ``pC'' and ``pCrsr'' are not.

It looks that GCC forgets to unpoison ``res'' for some reason. Looking at the GCC's test cases I would suggest: (a) to place label ``OP_SeekRowid'' just after declarations (i.e. after ``u64 iKey;'', and/or (b) to enclose ``case OP_NotExists:''...``break;'' into a nested, inner block, and/or (c) to open the block _before_ ``case OP_SeekRowid:''.

Unfortunately, ``gcc-7-branch'' still is decompressing on my hardware, so I cannot check which one(s) of above (a), (b), (c) will help. Regardless of all, the original problem concerns GCC rather then SQLite itself.

-- best regards

Cezary H. Noweta
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to