You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of DMD v2.111.0, compiling and executing the following program causes a segmentation fault:
char[] a = "foo".dup;
voidmain()
{
a[0] = 'b'; // Error: program killed by signal 11
}
Examining the compiled code with objdump reveals that this happens because the data for the array is stored in read-only memory, even though the array's element type is mutable:
As of DMD v2.111.0, compiling and executing the following program causes a segmentation fault:
Examining the compiled code with
objdump
reveals that this happens because the data for the array is stored in read-only memory, even though the array's element type is mutable:If the array is initialized with an array literal (
['f', 'o', 'o']
) instead of a.dup
ed string literal, the program runs successfully to completion.The text was updated successfully, but these errors were encountered: