Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Two issues found with -fsanitize=undefined



On 2015.09.19 at 20:57 +0100, Peter Stephenson wrote:
> On Thu, 17 Sep 2015 09:57:59 +0200
> Markus Trippelsdorf <markus@xxxxxxxxxxxxxxx> wrote:
> > 1)
> >  pattern.c:2645:12: runtime error: signed integer overflow: 1234567890123456789 * 10 cannot be represented in type 'long int'
> > Test ./D02glob.ztst failed: error output differs from expected as shown above for:
> 
> This might shut the compiler up, although the existing code should do
> the right thing anyway.  I don't have gcc 5.

Thanks. It fixes one issue. And please note that all issues reported by
running the instrumented shell, build with -fsanitize=undefined, are
_real_ undefined behavior bugs. So this is not about shutting the
compiler up, but making sure that undefined behavior isn't invoked
anymore.

BTW clang's -fsanitize=undefined report these additional cases during
D02glob.ztst:

./D02glob.ztst: starting.
exec.c:2240:6: runtime error: index 8 out of bounds for type 'int [8]'
exec.c:2048:10: runtime error: index 8 out of bounds for type 'int [8]'
exec.c:2122:7: runtime error: index 8 out of bounds for type 'int [8]'

-- 
Markus



Messages sorted by: Reverse Date, Date, Thread, Author