diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-25 08:16:24 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-25 20:57:31 +0100 |
commit | c92813bb456ffc4d7cadee441397d22742f89fc6 (patch) | |
tree | 5725b1aefbae5dbafbf83180fb0049fa3b85b736 /src/vhdl/vhdl-sem_expr.ads | |
parent | f89f72892acd07f4e161cf87370159f67836e212 (diff) | |
download | ghdl-c92813bb456ffc4d7cadee441397d22742f89fc6.tar.gz ghdl-c92813bb456ffc4d7cadee441397d22742f89fc6.tar.bz2 ghdl-c92813bb456ffc4d7cadee441397d22742f89fc6.zip |
vhdl: improve range checks, fix #2323
Diffstat (limited to 'src/vhdl/vhdl-sem_expr.ads')
-rw-r--r-- | src/vhdl/vhdl-sem_expr.ads | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/vhdl/vhdl-sem_expr.ads b/src/vhdl/vhdl-sem_expr.ads index b247d2d7e..19b817e67 100644 --- a/src/vhdl/vhdl-sem_expr.ads +++ b/src/vhdl/vhdl-sem_expr.ads @@ -114,19 +114,15 @@ package Vhdl.Sem_Expr is -- handled in this package. procedure Sem_Procedure_Call (Call : Iir_Procedure_Call; Stmt : Iir); - -- Analyze a range (ie a range attribute or a range expression). If - -- ANY_DIR is true, the range can't be a null range (slice vs subtype, - -- used in static evaluation). A_TYPE may be Null_Iir. + -- Analyze a range (ie a range attribute or a range expression). + -- A_TYPE may be Null_Iir. -- Return Null_Iir in case of error, or EXPR analyzed (and evaluated if -- possible). - function Sem_Range_Expression (Expr: Iir; A_Type: Iir; Any_Dir : Boolean) - return Iir; - - -- Analyze a discrete range. If ANY_DIR is true, the range can't be a - -- null range (slice vs subtype -- used in static evaluation). A_TYPE may - -- be Null_Iir. Return Null_Iir in case of error. - function Sem_Discrete_Range (Expr: Iir; A_Type: Iir; Any_Dir: Boolean) - return Iir; + function Sem_Range_Expression (Expr: Iir; A_Type: Iir) return Iir; + + -- Analyze a discrete range. A_TYPE may be Null_Iir. + -- Return Null_Iir in case of error. + function Sem_Discrete_Range (Expr: Iir; A_Type: Iir) return Iir; -- Analyze a discrete range and convert to integer if both bounds are -- universal integer types, according to rules of LRM 3.2.1.1 |