File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -1348,6 +1348,10 @@ expr2verilogt::convert_constant(const constant_exprt &src)
13481348 else
13491349 return convert_norep (src);
13501350 }
1351+ else if (type.id () == ID_verilog_null)
1352+ {
1353+ dest = " null" ;
1354+ }
13511355 else
13521356 return convert_norep (src);
13531357
Original file line number Diff line number Diff line change @@ -251,6 +251,16 @@ exprt verilog_lowering_cast(typecast_exprt expr)
251251 auto &src_type = expr.op ().type ();
252252 auto &dest_type = expr.type ();
253253
254+ if (src_type.id () == ID_verilog_null && dest_type.id () == ID_verilog_chandle)
255+ {
256+ return to_verilog_chandle_type (dest_type).null_expr ();
257+ }
258+
259+ if (src_type.id () == ID_verilog_null && dest_type.id () == ID_verilog_event)
260+ {
261+ return to_verilog_event_type (dest_type).null_expr ();
262+ }
263+
254264 // float to int
255265 if (
256266 (src_type.id () == ID_verilog_real ||
Original file line number Diff line number Diff line change @@ -2313,11 +2313,8 @@ void verilog_typecheck_exprt::implicit_typecast(
23132313 dest_type.id () == ID_verilog_class_type ||
23142314 dest_type.id () == ID_verilog_event)
23152315 {
2316- if (expr.id () == ID_constant)
2317- {
2318- expr.type () = dest_type;
2319- return ;
2320- }
2316+ expr = typecast_exprt{expr, dest_type};
2317+ return ;
23212318 }
23222319 }
23232320
You can’t perform that action at this time.
0 commit comments