cpp imgui demo with danger flag crashes
* **I'm submitting a ...**
  - [x] bug report
  - [ ] feature request
  - [ ] support request => Please do not submit support request here, see note
  at the top of this template.


* **What is the current behavior?**
App crashes with error


* **If the current behavior is a bug, please provide the steps to reproduce and
if possible a minimal demo of the problem**

  -  Change assert to doassert in imgui demo ( as assert won't work in danger )
  -  Run imgui demo


* **Please tell us about your environment:**
  - Tested both on devel and last stable nim version
  - OS: Windows 
  - Bindings: ImGui 
  - Backend: CPP 


* **Other information** (e.g. detailed explanation, stacktraces, related issues,
suggestions how to fix, links for us to have context, eg. stackoverflow,
docs.gl, documentation etc)

```nim
\nimcache\nimglimgui_r\stdlib_system.nim.cpp: In function 'void raiseExceptionAux__na8C8pUZ9cLQWVwk35l5vfw(Exception*)':
\nimcache\nimglimgui_r\stdlib_system.nim.cpp:4215:9: error: 'e' was not declared in this scope
 4215 |   throw e;
      |         ^

```

CPP coverted
```cpp
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionAux__na8C8pUZ9cLQWVwk35l5vfw)(Exception* e_0) {
{	{
		if (!!((localRaiseHook__EIvMhANBvB9cp2Ezvt29cADg == NIM_NIL))) goto LA3_;
{		{
			NIM_BOOL T7_ = localRaiseHook__EIvMhANBvB9cp2Ezvt29cADg(e_0);
			if (!!(T7_)) goto LA8_;
{			goto BeforeRet_;
}		}
		LA8_: ;
}	}
	LA3_: ;
	{
		if (!!((globalRaiseHook__JbO1ti4ULxrw54m4zNPbpA == NIM_NIL))) goto LA12_;
{		{
			NIM_BOOL T16_ = globalRaiseHook__JbO1ti4ULxrw54m4zNPbpA(e_0);
			if (!!(T16_)) goto LA17_;
{			goto BeforeRet_;
}		}
		LA17_: ;
}	}
	LA12_: ;
	{
		if (!(e_0 == currException__9bVPeDJlYTi9bQApZpfH8wjg)) goto LA21_;
{		throw;
}	}
	goto LA19_;
	LA21_: ;
	{
		pushCurrentException(e_0);
		throw e; // this is out of scope
	}
	LA19_: ;
	}BeforeRet_: ;
}
```