www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD crash with "= .dup" as an inout parameter

reply Chris Sauls <ibisbasenji gmail.com> writes:
Yes I know this is a silly naughty thing to do in the first place, but the
compiler still 
shouldn't crash.  Here's a minimal program that will cause the event.

# 1# int main (char[][] args) {
# 2#   int[] foo,
# 3#         bar;
# 4#
# 5#   func(bar = foo.dup);
# 6#   return 0;
# 7# }
# 8#
# 9# void func(inout int[] x) {
#10# }

It issues this error:
## bug.d(5): bar = _adDup(foo,4) is not an lvalue

Then crashes and burns.  I'm using DMD 0.128 on Windows.

-- Chris Sauls
Jul 17 2005
parent =?ISO-8859-1?Q?Thomas_K=FChne?= <thomas-dloop kuehne.THISISSPAM.cn> writes:
Chris Sauls wrote:
 Yes I know this is a silly naughty thing to do in the first place, but
 the compiler still shouldn't crash.  Here's a minimal program that will
 cause the event.

 # 1# int main (char[][] args) {
 # 2#   int[] foo,
 # 3#         bar;
 # 4#
 # 5#   func(bar = foo.dup);
 # 6#   return 0;
 # 7# }
 # 8#
 # 9# void func(inout int[] x) {
 #10# }

 It issues this error:
 ## bug.d(5): bar = _adDup(foo,4) is not an lvalue

 Then crashes and burns.  I'm using DMD 0.128 on Windows.
Added to DStress as http://dstress.kuehne.cn/nocompile/o/opAssign_01_A.d http://dstress.kuehne.cn/nocompile/o/opAssign_01_B.d Thomas
Jul 18 2005