Files
iverilog/ivtest/ivltests/macro_args.v
T
Sean Anderson b18d90a2d9 ivlpp: Fix segfault in macro_start_args
macro_start_args truncates def_buf, but does not check to ensure that
someone has allocated def_buf first. This will cause a null pointer
dereference if the first access to def_buf while parsing a file is a
macro invocation. Fix this by avoiding truncating def_buf if it is NULL,
as it is effectively already truncated.

Fixes: 680196953 ("Add support for text macros with arguments.")
Signed-off-by: Sean Anderson <[email protected]>
2022-10-30 18:02:40 -04:00

9 lines
101 B
Verilog

`ifndef FOO
`define FOO
`define BAR(x)
`endif
module macro_args();
macro_args_sub sub();
endmodule