[Issue 8651] Slice op Slice throws exceptions (not errors), and nothrow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 1 22:09:38 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8651


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com


--- Comment #6 from yebblies <yebblies at gmail.com> 2013-01-02 17:09:31 EST ---
(In reply to comment #5)
> 
> !!!!!!!!
> This is NOT FIXED.
> !!!!!!!!
> 
> This is very strange, because arraySliceSliceAddass_i *is* marked as nothrow.
> However, when calling "a[] += a[]", I still get:
> ----
> Error: _arraySliceSliceAddass_l is not nothrow
> ----
> 
> I'm not sure what to make about this? Maybe the "nothrow" info is lost in the
> "extern C" ?
> 
> If I place the code as a unittest *inside* "src/rt/arrayint.d", then it passes.
> But outside of that source, then... It doesn't compile.
> 
> We'd need one of the compiler guys (or just people that understand C and
> linking better than I do) to investigate.

Being C functions, the nothrowness is not part of the mangled name, otherwise
that change would have caused lots of link failures.  Inside the compiler
(arrayop.c) a dummy function declaration is created with the correct name, and
a call is inserted in place of the array op.

This function declaration needs to be changed for the compiler to pick it up as
nothrow, and it will need to be manually verified that the nothrowness matches
at both ends for each function.

A lot of druntime functions should probably have D linkage to prevent mistakes
like this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list