mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 22:13:25 +00:00
fix check_safe_func
This commit is contained in:
parent
ebe96a9ec6
commit
aabb52caae
@ -675,13 +675,8 @@ int main(int argc, char **argv);
|
|||||||
|
|
||||||
// ChatGPT told me that my function call would be safe with this.
|
// ChatGPT told me that my function call would be safe with this.
|
||||||
int check_safe_func(void* ptr){
|
int check_safe_func(void* ptr){
|
||||||
|
return ((size_t)ptr)>>32 | !( ptr>(size_t)malloc(10)
|
||||||
long long int v1 = ptr-(size_t)malloc(10);
|
||(ptr == &random_digit || ptr==&do_something || ptr==&get_time));
|
||||||
v1 >>= 6;
|
|
||||||
long long int v2 = ptr-((size_t)((size_t)&main)&~0xffff);
|
|
||||||
// TODO: remove
|
|
||||||
printf("[DEBUG] v1 = %lld, \tv2 = %lld\n",v1,v2);
|
|
||||||
return !(v2<0||(0<v1 && v1<31415926)||(ptr == &random_digit || ptr==&do_something || ptr==&get_time));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user