mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 09:18:31 +00:00
Implement more security stuff
- Support deterministic stacks on OpenBSD - Support OpenBSD system call origin verification - Fix overrun by one in chibicc string token allocator - Get all chibicc tests passing under Address Sanitizer
This commit is contained in:
parent
cbfd4ccd1e
commit
c843243322
56 changed files with 376 additions and 245 deletions
|
@ -6,19 +6,14 @@ COSMOPOLITAN_C_START_
|
|||
uint64_t tpenc(int32_t) pureconst;
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define tpenc(CODE) \
|
||||
({ \
|
||||
long Buf; \
|
||||
int32_t Code = (CODE); \
|
||||
if (0 <= Code && Code <= 127) { \
|
||||
Buf = Code; \
|
||||
} else { \
|
||||
asm("call\ttpenc" \
|
||||
: "=a"(Buf), "+D"(Code) \
|
||||
: /* inputs */ \
|
||||
: "rcx", "rdx", "cc"); \
|
||||
} \
|
||||
Buf; \
|
||||
#define tpenc(CODE) \
|
||||
({ \
|
||||
long Edi, Buf; \
|
||||
asm("call\ttpenc" \
|
||||
: "=a"(Buf), "=D"(Edi) \
|
||||
: "1"(CODE) \
|
||||
: "rcx", "rdx", "cc"); \
|
||||
Buf; \
|
||||
})
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue