July 18, 2005 DMD crash with "= .dup" as an inout parameter | ||||
|---|---|---|---|---|
  | ||||
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
 | ||||
July 18, 2005 Re: DMD crash with "= .dup" as an inout parameter | ||||
|---|---|---|---|---|
  | ||||
Posted in reply to Chris Sauls Attachments: 
  | 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  | |||
Copyright © 1999-2021 by the D Language Foundation
 
Permalink
Reply