Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid undefined behavior when doing pointer calculation. #1566

Merged
merged 1 commit into from
Aug 28, 2019

Commits on Aug 28, 2019

  1. Avoid undefined behavior when doing pointer calculation.

    Performing `base + offset` pointer arithmetic is only allowed when `base` itself is not nullptr. In other words, the compiler is assumed to allow that `base + offset` is always non-null, which an upcoming compiler release will do in this case. The result is that CommandStream.cpp, which calls this in a loop until the result is nullptr, will never terminate (until it runs junk data and crashes).
    
    Avoid this by using intptr_t instead of actual pointers (i.e. char*), which seems to avoid this failure.
    rupprecht committed Aug 28, 2019
    Configuration menu
    Copy the full SHA
    53245ec View commit details
    Browse the repository at this point in the history