"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/runnable/mars1.d" between
dmd-2.095.0.tar.gz and dmd-2.095.1.tar.gz

About: DMD (Digital Mars D) is the D reference compiler. D is an object-oriented, imperative, multi-paradigm system programming language.

mars1.d  (dmd-2.095.0):mars1.d  (dmd-2.095.1)
skipping to change at line 2348 skipping to change at line 2348
{ {
import core.sys.posix.sys.mman; import core.sys.posix.sys.mman;
auto p = mmap(null, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1 , 0L); auto p = mmap(null, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1 , 0L);
} }
assert(p); assert(p);
auto px = (cast(T*)(p + 4096 - 2 * T.sizeof)); auto px = (cast(T*)(p + 4096 - 2 * T.sizeof));
abc(px[0..2]); abc(px[0..2]);
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// https://issues.dlang.org/show_bug.cgi?id=21513
struct Stuff
{
size_t c; // declare after items and not crash !
ubyte[1] items;
}
void grow(ref Stuff stuff)
{
with (stuff)
{
const oldCapacity = c;
items.ptr[0..oldCapacity] = items.ptr[0..0]; // use literal 0 instead of
items.ptr[0] = 0; // oldcapacity and no crash
!
}
}
void test21513()
{
Stuff stuff;
grow(stuff);
}
////////////////////////////////////////////////////////////////////////
int main() int main()
{ {
// All the various integer divide tests // All the various integer divide tests
testsdiv2(); testsdiv2();
testulldiv(); testulldiv();
testfastudiv(); testfastudiv();
testsldiv(); testsldiv();
testslmod(); testslmod();
testfastdiv(); testfastdiv();
skipping to change at line 2443 skipping to change at line 2468
testsbbrex(); testsbbrex();
testmemcpy(); testmemcpy();
testMulLea(); testMulLea();
testMulAssPair(); testMulAssPair();
test21038(); test21038();
test21325(); test21325();
test19846(); test19846();
test16268(); test16268();
test11435a(); test11435a();
test11435b(); test11435b();
test21513();
printf("Success\n"); printf("Success\n");
return 0; return 0;
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)