Cevelop / Issues

The official issue tracker for Cevelop.
9 stars 1 forks source link

other plugins crash as well with my C++17 code #13

Closed PeterSommerlad closed 7 years ago

PeterSommerlad commented 7 years ago

Expected Behavior

Our CODAN plugins should just run, regardless of code that has syntax errors. May be it should not run on non-testcase files

Actual Behavior

crash of codan (not cevelop) eclipse.buildId=unknown java.version=1.8.0_66 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -keyring /Users/sop/.eclipse_keyring Command-line arguments: -os macosx -ws cocoa -arch x86_64 -data /Users/sop/Documents/C++WG21/SC22WG21_Papers/workspace -keyring /Users/sop/.eclipse_keyring

org.eclipse.cdt.codan.core Error Thu Feb 16 17:52:43 CET 2017 Internal Error

java.lang.ArrayIndexOutOfBoundsException: 0 at ch.hsr.ifs.cute.charwars.checkers.ProblemReport.createProblemLocation(ProblemReport.java:39) at ch.hsr.ifs.cute.charwars.checkers.ProblemReport.(ProblemReport.java:27) at ch.hsr.ifs.cute.charwars.checkers.PointerParameterProblemGenerator.generate(PointerParameterProblemGenerator.java:24) at ch.hsr.ifs.cute.charwars.checkers.CharWarsChecker$CharWarsCheckerVisitor.visit(CharWarsChecker.java:110) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration.accept(CPPASTParameterDeclaration.java:93) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator.postAccept(CPPASTFunctionDeclarator.java:276) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator.accept(CPPASTDeclarator.java:204) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:204) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier.accept(CPPASTCompositeTypeSpecifier.java:199) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration.accept(CPPASTSimpleDeclaration.java:100) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTemplateDeclaration.accept(CPPASTTemplateDeclaration.java:123) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:136) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:136) at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:266) at ch.hsr.ifs.cute.charwars.checkers.CharWarsChecker.processAst(CharWarsChecker.java:42) at org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker.processModel(AbstractIndexAstChecker.java:117) at org.eclipse.cdt.codan.internal.core.CodanRunner.processResource(CodanRunner.java:91) at org.eclipse.cdt.codan.internal.core.CodanRunner.runInEditor(CodanRunner.java:46) at org.eclipse.cdt.codan.internal.core.CodanBuilder.processResource(CodanBuilder.java:126) at org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanReconciler.reconciledAst(CxxCodanReconciler.java:37) at org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler.reconciled(CodanCReconciler.java:57) at org.eclipse.cdt.internal.ui.editor.CEditor.reconciled(CEditor.java:3103) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:99) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:63) at org.eclipse.cdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:87) at org.eclipse.cdt.internal.ui.text.CCompositeReconcilingStrategy.reconcile(CCompositeReconcilingStrategy.java:90) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:73) at org.eclipse.cdt.internal.ui.text.CReconciler.process(CReconciler.java:349) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:207)

Cevelop Version, Operating System and Compiler

Version: 1.6.0-201701201507

tonisuter commented 7 years ago

The problem was that CharWars didn't correctly handle the possibility of having a parameter without a name. For example:

void f(int *) {}
int main() {}

This is now fixed in the master branch.