Fix emitting `this` (#5849)

This commit is contained in:
Wilson Snyder 2025-03-11 17:53:35 -04:00
parent 78198d90e1
commit 53151d7c5f
3 changed files with 5 additions and 0 deletions

View File

@ -634,6 +634,7 @@ class EmitVBaseVisitorConst VL_NOT_FINAL : public EmitCBaseVisitorConst {
iterateAndNextConstNull(nodep->fromp());
puts(cvtToStr(nodep->declRange()));
}
void visit(AstThisRef* nodep) override { puts("this"); }
void visit(AstTypedef* nodep) override {
putfs(nodep, "typedef ");
iterateConstNull(nodep->subDTypep());

View File

@ -331,6 +331,9 @@ package Vt_debug_emitv___024unit;
int signed member;
member = 'sh1;
task method;
if ((this != this)) begin
$stop;
end
endtask
function new;
endfunction

View File

@ -22,6 +22,7 @@ endpackage
class Cls;
int member = 1;
function void method;
if (this != this) $stop;
endfunction
endclass