Skip to content
Commit 87a31803 authored by Reid Kleckner's avatar Reid Kleckner
Browse files

Re-land "[Sema] Make getCurFunction() return null outside function parsing"

This relands r326965.

There was a null dereference in typo correction that was triggered in
Sema/diagnose_if.c. We are not always in a function scope when doing
typo correction. The fix is to add a null check.

LLVM's optimizer made it hard to find this bug. I wrote it up in a
not-very-well-editted blog post here:
http://qinsb.blogspot.com/2018/03/ub-will-delete-your-null-checks.html

llvm-svn: 327334
parent 7147f32e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment