[Issue 7337] subclasses without invariants don't check basisclass invariant after method

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 29 15:19:16 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=7337

--- Comment #5 from Adrien Pensart <crunchengine at gmail.com> ---
diff --git a/src/func.c b/src/func.c
index 93ca8fd..395cb51 100644
--- a/src/func.c
+++ b/src/func.c
@@ -3933,7 +3933,7 @@ bool FuncDeclaration::addPostInvariant()
     AggregateDeclaration *ad = isThis();
     ClassDeclaration *cd = ad ? ad->isClassDeclaration() : NULL;
     return (ad && !(cd && cd->isCPPclass()) &&
-            ad->inv &&
+            //ad->inv &&
             global.params.useInvariants &&
             (protection == PROTprotected || protection == PROTpublic ||
protection == PROTexport) &&
             !naked &&

There is multiple problems, i'll try to give you what i tested but phobos is
ok.

A trivial error in druntime, it does not compile the first time, but it works
if we replay the exact command, i don't know why (MODEL=64 make -j4 -f
posix.mak install) : 

src/core/sync/semaphore.d(182): Error: function
core.sync.semaphore.Semaphore.wait no return exp; or assert(0); at end of
function
src/core/sync/semaphore.d(298): Error: function
core.sync.semaphore.Semaphore.tryWait no return exp; or assert(0); at end of
function

some test failed in dmd suite : 

* compilable/interpret3.d : 

../src/dmd -m64 -Icompilable   -odtest_results/compilable
-oftest_results/compilable/interpret3_0.o -c compilable/interpret3.d
compilable/interpret3.d(143): Error: assert(w.r.x == 4) failed
compilable/interpret3.d(181):        called from here: retRefTest2()
compilable/interpret3.d(181):        while evaluating: static
assert(retRefTest2() == 2)
dmd: interpret.c:180: void CtfeStack::setValue(VarDeclaration*, Expression*):
Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()'
failed.
Aborted

==============================
Test failed: expected rc == 0, exited with rc == 134

Makefile:163: recipe for target 'test_results/compilable/interpret3.d.out'
failed

* runnable/sdtor.d : 

Test failed.  The logged output:
../src/dmd -m64 -Irunnable   -odtest_results/runnable
-oftest_results/runnable/sdtor_0 runnable/sdtor.d
S7353
test_results/runnable/sdtor_0
core.exception.AssertError at runnable/sdtor.d(859): Assertion failure
----------------
test_results/runnable/sdtor_0() [0x445679]
test_results/runnable/sdtor_0(void sdtor.test33()+0x8e) [0x437c36]
test_results/runnable/sdtor_0(_Dmain+0xa9) [0x443841]
test_results/runnable/sdtor_0(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x1f)
[0x44963b]
test_results/runnable/sdtor_0(void rt.dmain2._d_run_main(int, char**, extern
(C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x44958e]
test_results/runnable/sdtor_0(void rt.dmain2._d_run_main(int, char**, extern
(C) int function(char[][])*).runAll()+0x30) [0x4495f4]
test_results/runnable/sdtor_0(void rt.dmain2._d_run_main(int, char**, extern
(C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x44958e]
test_results/runnable/sdtor_0(_d_run_main+0x193) [0x44950f]
test_results/runnable/sdtor_0(main+0x17) [0x4456c7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f475382fb45]

[...output...]

==============================
Test failed: expected rc == 0, exited with rc == 1

--


More information about the Digitalmars-d-bugs mailing list