diff options
author | Tristan Gingold | 2014-11-17 05:56:50 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-11-17 05:56:50 +0100 |
commit | 56ab294531f7c12ae9407df88ec12c448e695e5a (patch) | |
tree | f182b3b7dac85e88ac277bc5b974fcf3f70f7cc7 /src/ortho/mcode | |
parent | f0fc4fdc5a5a2400a084a0bfe775550d3f816f60 (diff) | |
download | ghdl-56ab294531f7c12ae9407df88ec12c448e695e5a.tar.gz ghdl-56ab294531f7c12ae9407df88ec12c448e695e5a.tar.bz2 ghdl-56ab294531f7c12ae9407df88ec12c448e695e5a.zip |
ortho_mcode: add assertion.
Diffstat (limited to 'src/ortho/mcode')
-rw-r--r-- | src/ortho/mcode/ortho_code-exprs.adb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ortho/mcode/ortho_code-exprs.adb b/src/ortho/mcode/ortho_code-exprs.adb index b2dfa1a..9cfffd1 100644 --- a/src/ortho/mcode/ortho_code-exprs.adb +++ b/src/ortho/mcode/ortho_code-exprs.adb @@ -327,9 +327,12 @@ package body Ortho_Code.Exprs is procedure Link_Stmt (Stmt : O_Enode) is begin - if Last_Stmt = O_Enode_Null then - raise Program_Error; - end if; + -- Expect a real statement. + pragma Assert (Stmt /= O_Enode_Null); + + -- Must be withint a subprogram. + pragma Assert (Last_Stmt /= O_Enode_Null); + Set_Stmt_Link (Last_Stmt, Stmt); Last_Stmt := Stmt; end Link_Stmt; |