On 04/07/2014 06:17 PM, Peter Maydell wrote:
On 7 April 2014 15:56, Avi Kivity <a...@cloudius-systems.com> wrote:
On 04/06/2014 01:18 PM, Peter Maydell wrote:
The alternative would be to say that Int128 should have
undefined behaviour on underflow/overflow and the test
code is wrong, but that doesn't seem very useful to me.
Isn't the test broken here?  It is trying to add (or shift) -2^127 and
something else, and the result truly overflows.
Well, the test code is assuming "semantics as per 2s
complement arithmetic" and checking various corner cases.
As I say, we could define that this is invalid and
rewrite the test cases.

It is invalid. The test thinks that -2^127 * 2 == 0, but if a guest could trigger it, it would probably be a security issue.



Reply via email to