__errcode
function · crt · primitive
- Address
0x40cf37· 45 bytes, up to0x40cf63- Signature
int32_t __cdecl (uint32_t flags)- Meaning
- Maps exception flags to an error type: 0x20 gives 5, 8 gives 1, 4 gives 2, 1 gives 3, else (flags and 2) times 2
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- Finding
- crt/math#math-error-flags
- Test
crt::crt_frexp_difftest
Finding: Math error flags in crt: math routines
The error exits of these routines set errno and return the value they hold; none calls a
_matherr hook. 0x831ac8 holds 0x2694 and nothing writes it, which is what skips the hook;
0x883918, written only by the unreached 0x409a61, stays 0, so the dispatcher's exit reports
every error. 0x88391c, set at start-up from 0x40b425, is the processor's FDIV erratum answer,
1 only on a flawed Pentium, so a current CPU runs fprem. __87except takes an error type: 1 marks
the masked invalid operation through __handle_exc and 7, a quiet NaN, becomes 1 and skips the
marking; __set_errno stores 33 for type 1 and 34 for 2 and 3.
The derivation is in the doc.
Callers 2
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.