Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /cmajor++/Cm/Cm.Core/Exception.cpp [r570] .. [r571] Maximize Restore

  Switch to side-by-side view

--- a/cmajor++/Cm/Cm.Core/Exception.cpp
+++ b/cmajor++/Cm/Cm.Core/Exception.cpp
@@ -61,15 +61,7 @@
 
 void ExceptionHandler::TypeCheckBody(TypeCheckContext& context)
 {
-    StatementPtr firstHandlerStatement = catchBlock->Statements().empty() ? nullptr : catchBlock->Statements().front().get();
-    if (!firstHandlerStatement)
-    {
-        firstHandlerStatement = StatementPtr(new EmptyStatement(catchBlock->Pos(), catchBlock->GetEnclosingScope(), catchBlock->GetFileScope(), ""));
-        firstHandlerStatement->SetFunction(GetFunction());
-        firstHandlerStatement->SetCompound(catchBlock);
-        catchBlock->InsertStatement(0, firstHandlerStatement);
-    }
-    firstHandlerStatement->SetFirstHandlerStatement();
+    catchBlock->SetAsCatchBlock();
     Object::TypeCheckBody(context);
     context.PushExtent(TypeCheckExtent::signature);
     TypeChecker::TypeCheck(exceptionTypeExpr, context);
@@ -121,8 +113,11 @@
     StatementPtr constructExStatement(new ConstructionStatement(Pos(), catchBlock->GetScope(), GetFileScope(), "", exceptionTypeExpr, exceptionVarName, ExpressionList(1, derefExpr)));
     constructExStatement->SetFunction(GetFunction());
     constructExStatement->SetCompound(catchBlock);
+    getExPtrStatement->SetGenNoDebugInfo();
     catchBlock->InsertStatement(0, getExPtrStatement);
+    constructExDeleterStatement->SetGenNoDebugInfo();
     catchBlock->InsertStatement(1, constructExDeleterStatement);
+    constructExStatement->SetGenNoDebugInfo();
     catchBlock->InsertStatement(2, constructExStatement);
     catchBlock->TypeCheck(context);
 }