[cfe-dev] -fcatch-undefined-behavior testing

Jan 'RedBully' Seiffert redbully at cc.hs-owl.de
Wed Dec 16 16:21:29 PST 2009


1. Nice!

2.
 ....
 804bc26:       0f 0b                   ud2a
 ....
 804bd1f:       83 f8 02                cmp    $0x2,%eax
 804bd22:       0f 87 63 01 00 00       ja     804be8b <main+0xecb>
 804bd28:       83 f8 03                cmp    $0x3,%eax
 804bd2b:       0f 87 f5 fe ff ff       ja     804bc26 <main+0xc66>
 ....

Thats what i get for defensiv coding? :(
(after the first couple instances of stuff like this i stopped grepping for ud2a
and it's addresses)

3.
Can clang/llvm use into (the only conditional trap on x86) for such things?
Or int3? Should give a:
SIGTRAP        5        Core    Trace/breakpoint trap
Or drop you into the debugger.

Greetings
	Jan

-- 
The Theorem Theorem: If If, Then Then.



More information about the cfe-dev mailing list