Integer overflow in Sawzall

15 views
Skip to first unread message

Adrian Colley

unread,
Jun 17, 2014, 7:30:14 PM6/17/14
to szl-...@googlegroups.com
What's the correct behavior on integer overflow in a Sawzall program?

The "Sawzall Language" document (http://szl.googlecode.com/svn/doc/sawzall-language.html) ranks it with division-by-zero and bad array indices, strongly implying that it should result in an undefined value.

The language specification (http://szl.googlecode.com/svn/doc/sawzall-spec.html) is completely silent on the matter, as is the original paper (http://research.google.com/archive/sawzall.html).

Almost convincingly, one of the unit tests expects a particular kind of integer wraparound (https://code.google.com/p/szl/source/browse/trunk/src/engine/language_tests/base/arith.szl), and definitely not undefined-replacement. And yes, the test passes (unless you use g++ 4.9's -fsanitize=undefined flag).

So, what's with the clear disconnect between spec and code? Which one has the bug?

 --Adrian.
parser of karma-separated values

Reply all
Reply to author
Forward
0 new messages