[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-bugs] Git version: function returning address of parameter



I think whether parameter passing constitutes a "read by an lvalue
expression" is debatable. But I recognize this is a Csmith problem and will
fix it soon.

-Xuejun
 
> Anyway, the .tar.gz file is still the aforementioned
> csmith-project-csmith-git-conversion-HEAD-34-g1e0418a.tar.gz
> and it generated the attached program.
> I modified it only by inserting the line that contains "DANGLING CHECK".
> 
> When I compile it as a little-endian 64-bit program with gcc, I get:
> 
> DANGLING CHECK: &p_5:0x7fffaceb008c, returning:0x7fffaceb008c checksum
> = E94CCCEA
> 
> We have had this discussion with John before, but I would argue that
passing
> the result of func_4() to func_2() counts as "read[ing]" in:
> 
> "The value of a pointer becomes indeterminate when the object it points to
> reaches the end of its lifetime. (6.2.4 §2)"
> 
> "indeterminate value: either an unspecified value or a trap representation
> (3.7.12)"
> 
> "Certain object representations need not represent a value of the object
type.
> If the stored value of an object has such a representation and is read by
an
> lvalue expression that does not have
> character type, the behavior is undefined. [...]	Such a
representation
> is called a trap representation. (6.2.6.1 §5)."
> 
> Pascal