RE: [sv-ec] copy constructor on handle pointing null

From: Rich, Dave <Dave_Rich_at_.....>
Date: Wed Aug 27 2008 - 10:27:23 PDT
Hi Arturo,

 

I guess the error depends on whose simulator you are using. :-)

 

A copy of nothing is nothing could be another interpretation.

 

Dave

 

 

________________________________

From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
Behalf Of Arturo Salz
Sent: Wednesday, August 27, 2008 9:45 AM
To: Daniel Mlynek; SV-EC
Subject: RE: [sv-ec] copy constructor on handle pointing null

 

Daniel,

 

Calling the copy constructor with a null object should trigger a
run-time error. The LRM does state that the class properties and
internal state must be copied - and that will definitely triggers an
error.

 

            Arturo

 

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Daniel Mlynek
Sent: Wednesday, August 27, 2008 12:48 AM
To: 'SV-EC'
Subject: [sv-ec] copy constructor on handle pointing null

 

LRM doesn't describe what should happend if handle which we are trying
to copy is equal null like in sample below. Should it trigger runtime
error that this is illegall null refrence, or should it silently assign
destination hadle with null ( performing no allocation)?

 

module top; 
 class C;
  int a;
 endclass 

 C c1,c2 ;
 initial begin
     c1 = new c2;    
 end
endmodule

 

 

 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Aug 27 10:28:36 2008

This archive was generated by hypermail 2.1.8 : Wed Aug 27 2008 - 10:29:08 PDT