mirror of
https://github.com/verilator/verilator.git
synced 2026-10-02 16:13:34 +02:00
Fix references to members of results of static methods (#4327)
This commit is contained in:
+2
-1
@@ -3049,7 +3049,8 @@ private:
|
||||
}
|
||||
UASSERT_OBJ(cpackagerefp->classOrPackagep(), m_ds.m_dotp->lhsp(), "Bad package link");
|
||||
nodep->classOrPackagep(cpackagerefp->classOrPackagep());
|
||||
m_ds.m_dotPos = DP_SCOPE;
|
||||
// Class/package :: HERE function() . method_called_on_function_return_value()
|
||||
m_ds.m_dotPos = DP_MEMBER;
|
||||
m_ds.m_dotp = nullptr;
|
||||
} else if (m_ds.m_dotp && m_ds.m_dotPos == DP_FINAL) {
|
||||
nodep->dotted(m_ds.m_dotText); // Maybe ""
|
||||
|
||||
@@ -42,6 +42,18 @@ class Getter1;
|
||||
endfunction
|
||||
endclass
|
||||
|
||||
class uvm_root;
|
||||
int x;
|
||||
static uvm_root m_inst;
|
||||
static function uvm_root get_inst();
|
||||
if (m_inst == null) m_inst = new;
|
||||
return m_inst;
|
||||
endfunction
|
||||
function int get_7();
|
||||
return 7;
|
||||
endfunction
|
||||
endclass
|
||||
|
||||
module t (/*AUTOARG*/
|
||||
);
|
||||
|
||||
@@ -68,6 +80,11 @@ module t (/*AUTOARG*/
|
||||
|
||||
if (getter1.get_1 != 1) $stop;
|
||||
|
||||
uvm_root::get_inst().x = 6;
|
||||
if (uvm_root::get_inst().x != 6) $stop;
|
||||
|
||||
if (uvm_root::get_inst().get_7() != 7) $stop;
|
||||
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user