summary refs log tree commit diff stats
path: root/compiler/cgen.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r--compiler/cgen.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 8d66d7a3b..198b1187d 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -503,7 +503,8 @@ proc assignLocalVar(p: BProc, s: PSym) =
     if sfRegister in s.flags: app(decl, " register")
     #elif skipTypes(s.typ, abstractInst).kind in GcTypeKinds:
     #  app(decl, " GC_GUARD")
-    if sfVolatile in s.flags or p.nestedTryStmts.len > 0: 
+    if sfVolatile in s.flags or (p.nestedTryStmts.len > 0 and
+                                 gCmd != cmdCompileToCpp):
       app(decl, " volatile")
     appf(decl, " $1;$n", [s.loc.r])
   else: