diff --git a/elab_expr.cc b/elab_expr.cc index 95fbd4cb1..5a4e20b41 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -2542,6 +2542,8 @@ NetExpr* PECastSize::elaborate_expr(Design*des, NetScope*scope, cast_width = expr_width_; NetExpr*sub = base_->elaborate_expr(des, scope, cast_width, flags); + if (sub == 0) + return 0; // Perform the cast. The extension method (zero/sign), if needed, // depends on the type of the base expression. @@ -2622,6 +2624,8 @@ NetExpr* PECastType::elaborate_expr(Design*des, NetScope*scope, cast_width = expr_width_; NetExpr*sub = base_->elaborate_expr(des, scope, cast_width, flags); + if (sub == 0) + return 0; if (dynamic_cast(target_)) { return cast_to_real(sub); @@ -2669,6 +2673,7 @@ NetExpr* PECastType::elaborate_expr(Design*des, NetScope*scope, } cerr << get_fileline() << ": sorry: This cast operation is not yet supported." << endl; + des->errors += 1; return 0; }