1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 396134 - NPE when extracting function inside a method

Change-Id: Ia396d906196543249f0370f47d2b4f08782f9219
Reviewed-on: https://git.eclipse.org/r/12670
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
Marc-Andre Laperle 2013-05-08 23:41:40 -04:00
parent 1ddcf867ab
commit 2dd6c882a4

View file

@ -1582,11 +1582,11 @@ public class CPPVisitor extends ASTQueries {
return true; return true;
} }
if ((binding1 instanceof IIndexBinding) != (binding2 instanceof IIndexBinding) && index != null) { if ((binding1 instanceof IIndexBinding) != (binding2 instanceof IIndexBinding) && index != null) {
if (binding1 instanceof IIndexBinding) { // Even though we know one of them is an index binding, we need to adapt both because they might not come from an
binding2 = index.adaptBinding(binding2); // index with the same number of fragments. So one of them could be a composite binding and the other one not.
} else { binding1 = index.adaptBinding(binding1);
binding1 = index.adaptBinding(binding1); binding2 = index.adaptBinding(binding2);
}
if (binding1 == null || binding2 == null) { if (binding1 == null || binding2 == null) {
return false; return false;
} }