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)
1348
1348
else
1349
1349
return convert_norep (src);
1350
1350
}
1351
+ else if (type.id () == ID_verilog_null)
1352
+ {
1353
+ dest = " null" ;
1354
+ }
1351
1355
else
1352
1356
return convert_norep (src);
1353
1357
Original file line number Diff line number Diff line change @@ -251,6 +251,16 @@ exprt verilog_lowering_cast(typecast_exprt expr)
251
251
auto &src_type = expr.op ().type ();
252
252
auto &dest_type = expr.type ();
253
253
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
+
254
264
// float to int
255
265
if (
256
266
(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(
2313
2313
dest_type.id () == ID_verilog_class_type ||
2314
2314
dest_type.id () == ID_verilog_event)
2315
2315
{
2316
- if (expr.id () == ID_constant)
2317
- {
2318
- expr.type () = dest_type;
2319
- return ;
2320
- }
2316
+ expr = typecast_exprt{expr, dest_type};
2317
+ return ;
2321
2318
}
2322
2319
}
2323
2320
You can’t perform that action at this time.
0 commit comments