mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-07 17:15:25 +02:00
This is the same (simple) fix as was applied last night on the HEAD branch
for https://bugs.eclipse.org/bugs/show_bug.cgi?id=50821 The consequences of not applying it is that the scanner's error handling strategy causes an out-of-memory error to happen on a unterminated character literal when CModelBuilder kicks in (i.e. on save or reconcile).
This commit is contained in:
parent
2f1d6c7f94
commit
757ce6fd26
6 changed files with 32 additions and 1 deletions
|
@ -3,7 +3,9 @@
|
|||
<name>org.eclipse.cdt.core.tests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>org.apache.xerces</project>
|
||||
<project>org.eclipse.cdt.core</project>
|
||||
<project>org.eclipse.cdt.core.aix</project>
|
||||
<project>org.eclipse.cdt.core.linux</project>
|
||||
<project>org.eclipse.cdt.core.qnx</project>
|
||||
<project>org.eclipse.cdt.core.solaris</project>
|
||||
|
@ -11,6 +13,12 @@
|
|||
<project>org.eclipse.cdt.make.core</project>
|
||||
<project>org.eclipse.cdt.managedbuilder.core</project>
|
||||
<project>org.eclipse.cdt.ui</project>
|
||||
<project>org.eclipse.core.boot</project>
|
||||
<project>org.eclipse.core.resources</project>
|
||||
<project>org.eclipse.core.runtime</project>
|
||||
<project>org.eclipse.swt</project>
|
||||
<project>org.eclipse.ui</project>
|
||||
<project>org.junit</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
2004-01-29 John Camelon
|
||||
Added ScannerTestCase::testBug50821().
|
||||
|
||||
2003-11-07 John Camelon
|
||||
Moved testBug39554() from ASTFailedTests to QuickParseASTTests.
|
||||
|
||||
|
|
|
@ -1528,4 +1528,13 @@ public class ScannerTestCase extends BaseScannerTest
|
|||
assertEquals( callback.inclusions.size(), 1 );
|
||||
assertEquals( callback.inclusions.get(0), "stdio.h");
|
||||
}
|
||||
|
||||
public void testBug50821() throws Exception
|
||||
{
|
||||
Callback callback = new Callback( ParserMode.QUICK_PARSE );
|
||||
initializeScanner( "\'\n\n\n", ParserMode.QUICK_PARSE, callback );
|
||||
scanner.nextToken();
|
||||
assertEquals( callback.problems.size(), 1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
<name>org.eclipse.cdt.core</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>org.apache.xerces</project>
|
||||
<project>org.eclipse.compare</project>
|
||||
<project>org.eclipse.core.boot</project>
|
||||
<project>org.eclipse.core.resources</project>
|
||||
<project>org.eclipse.core.runtime</project>
|
||||
<project>org.eclipse.debug.core</project>
|
||||
<project>org.eclipse.search</project>
|
||||
<project>org.eclipse.team.core</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
2004-01-29 John Camelon
|
||||
Fixed Bug 50821 - Freezes when opening / saving .c file
|
||||
|
||||
2003-11-07 John Camelon
|
||||
Fixed Bug 39554 : _Pragma directive is not supported (ANSI C99)
|
||||
|
||||
|
|
|
@ -1616,7 +1616,7 @@ public class Scanner implements IScanner {
|
|||
( c == NOCHAR ) )
|
||||
{
|
||||
handleProblem( IProblem.SCANNER_BAD_CHARACTER, new Character( (char)c ).toString(),beginOffset, false, true, throwExceptionOnBadCharacterRead );
|
||||
c = ' ';
|
||||
c = '\'';
|
||||
}
|
||||
// exit condition
|
||||
if ( ( c =='\'' ) && ( prev != '\\' || prevPrev == '\\' ) ) break;
|
||||
|
|
Loading…
Add table
Reference in a new issue