News for hackers. Stuff that matters.
Re:Introducing MIR by DannyBee on Wednesday April 27, 2016 @05:02PM (#11584526)
First, remember that getelementptr != array indices.

Second, remember that even in C, you can't actually dereference things outside of the bounds of an object, even if you can form addresses to it.

In any case, the point was more than something like

  struct foo C;

  char *foo = &C
  foo -= 7;
  char whee = *foo;
Is legal in llvm, but not in say, C++ (and in fact, in most languages it's not legal because it's not aligned properly)
Re:Introducing MIR by pklausler on Wednesday April 27, 2016 @05:36PM (#11584766)
"char" in C/C++ can't be misaligned.
Re:Introducing MIR by DannyBee on Wednesday April 27, 2016 @09:23PM (#11585978)
I didn't say it can, i said "in fact, in most languages" (IE not C/C++). In C/C++, it's illegal for other reasons.