Displaying 3 results from an estimated 3 matches for "ptr_val".
Did you mean:
pte_val
2017 Jul 06
2
GEP with a null pointer base
I’m not entirely opposed to solution #3. As I said, my concern is that there are cases it would miss.
For instance, if I had some code like this:
char *get_ptr(char *base, intptr_t offset) {
return base + offset;
}
char *convert_to_ptr(intptr_t ptr_val) {
return get_ptr((char*)0, ptr_val);
}
There the idiom would only appear after inlining, so the front end couldn’t handle it. The current glibc code is implemented with a couple of layers of macros that have a logical branch that could theoretically result in the null coming in via a PHI, but...
2011 Aug 19
1
[LLVMdev] LLVM: Very simple question
Hi, guys. I'm a newbie to LLVM and have a very simple question.
Which instructions should I use (in terms of IRBuilder calls) to allocate an
array of bytes in stack (alloca?), then to work with it (from a given
offset) as with integer (bitcast?). I mean something like that:
unsigned char var[8];
unsigned int offset = 3;
int val = *(int*)(&var+offset); /* read */
*(int*)(&var+offset)
2017 Jul 06
5
GEP with a null pointer base
Hi everyone,
I've got a problem that I would like some input on. The problem basically boils down to a program that I am compiling, whose source I don't control, doing something like this:
p = (char*)0 + n
where 'n' is an intptr_t-sized value that the program knows is actually a valid address for a pointer.
clang translates this as
%p = getelementptr inbounds i8, i8*