mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
Bug 516686 - ArrayIndexOutOfBoundsException in CPPASTLiteralExpression.computeStringLiteralSize()
Change-Id: I45ce05315c57847bf8ae784b2fe7569a72716894
This commit is contained in:
parent
b0cfef83db
commit
4412c851ab
2 changed files with 8 additions and 2 deletions
|
@ -121,7 +121,13 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
return fSuffix;
|
||||
}
|
||||
|
||||
public void setSuffix(char[] suffix) {
|
||||
public void addSuffix(char[] suffix) {
|
||||
setSuffix(suffix);
|
||||
// Make sure fValue reflects the added suffix.
|
||||
fValue = CharArrayUtils.concat(fValue, suffix);
|
||||
}
|
||||
|
||||
private void setSuffix(char[] suffix) {
|
||||
this.fSuffix = suffix;
|
||||
}
|
||||
|
||||
|
|
|
@ -2005,7 +2005,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return literalExprWithRange;
|
||||
}
|
||||
IToken opName = consume(IToken.tIDENTIFIER);
|
||||
((CPPASTLiteralExpression) literalExprWithRange).setSuffix(opName.getCharImage());
|
||||
((CPPASTLiteralExpression) literalExprWithRange).addSuffix(opName.getCharImage());
|
||||
setRange(literalExprWithRange, offset, opName.getEndOffset());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue