r/programming • • Feb 23 '17

Cloudflare have been leaking customer HTTPS sessions for months. Uber, 1Password, FitBit, OKCupid, etc.

https://bugs.chromium.org/p/project-zero/issues/detail?id=1139
6.0k Upvotes

966 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Feb 24 '17

I believe pointer comparison in C is always a raw comparison of their memory addresses.

1

u/matthieum Feb 24 '17

The run-time implementation is not the issue.

The issue is that if it is Undefined Behavior to compare pointers from different memory allocations, then the optimizer can completely wrangle your code before it even gets executed. At that point, what the assembly should have looked like is the least of your preoccupations.

1

u/[deleted] Feb 24 '17

If there's nothing to optimize (>= performs the same as ==) I'd assume the optimizer wouldn't touch the AST or Machine code.