digitalmars.D.bugs - [Issue 8216] New: CTFE should allow 'pointer is inside range' comparisons
- d-bugmail puremagic.com (41/41) Jun 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8216
- d-bugmail puremagic.com (10/10) Jun 11 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8216
- d-bugmail puremagic.com (15/15) Jun 11 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8216
- d-bugmail puremagic.com (11/11) Jun 26 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8216
- d-bugmail puremagic.com (12/12) Jul 04 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8216
http://d.puremagic.com/issues/show_bug.cgi?id=8216 Summary: CTFE should allow 'pointer is inside range' comparisons Product: D Version: D1 & D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: clugdbug yahoo.com.au --- Comment #0 from Don <clugdbug yahoo.com.au> 2012-06-09 23:13:06 PDT --- Currently all < and > comparisons of pointers do not compile in CTFE if the pointers are non-null and point to unrelated memory blocks, because the relative ordering of the memory blocks is undefined. But this gives not way to check if a pointer lies within a range, even though that operation doesn't actually depend on the ordering of the memory blocks. My patch implements *all* cases where the memory block ordering is checked in *both* directions within a single && or || expression. That is, expressions of the form: ( p1 > q1 && p2 <= q2 ) ( p1 < q1 || p2 > q2 ) where p1, p2, q1, q2 are arbitrary expressions of type pointer. p1 and p2 must point to memory block P, q1 and q2 must point to memory block Q. Each operators can be >, <, >=, or <=, and ! can be added anywhere, provided that eventual effect of the comparison is a check that P is inside Q, or P is outside Q. I believe this satisfies the primary requests made on the newsgroup: * It provides a way to check if a pointer lies inside a particular memory block; * It is safe and pure - it never involves undefined or compiler-specific behaviour * The situations where it is valid are broad and yet clearly defined -- _anything_ within a && or || will work. * Most code which wasn't written with CTFE in mind, will work in CTFE without modification. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 09 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8216 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |CTFE, pull --- Comment #1 from Don <clugdbug yahoo.com.au> 2012-06-11 04:33:11 PDT --- https://github.com/D-Programming-Language/dmd/pull/998 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 11 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8216 --- Comment #2 from github-bugzilla puremagic.com 2012-06-11 08:10:59 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/65aa891c4891f4aa3a7d9ddee6b9c41a90ceaa4b Fix issue 8216 CTFE should allow 'pointer is inside range' comparisons Allows comparisons between pointers to unrelated memory blocks as long as both directions are checked within a single && or || expression. Never allows the ordering to be exposed to user code. (In fact, internally there isn't any ordering!) https://github.com/D-Programming-Language/dmd/commit/9a70c56ba3d18d5aa512a88b0e820ef3ef95b191 Merge pull request #998 from donc/8216pointerInsideCTFE Fix issue 8216 CTFE should allow 'pointer is inside range' comparisons -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 11 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8216 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #3 from Don <clugdbug yahoo.com.au> 2012-06-27 00:01:05 PDT --- merged into D1 in https://github.com/D-Programming-Language/dmd/commit/9071bdd5 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 26 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8216 --- Comment #4 from github-bugzilla puremagic.com 2012-07-04 21:38:04 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/d-programming-language.org https://github.com/D-Programming-Language/d-programming-language.org/commit/cf94e3a990a506e749bb6e6ab7c343c369c5f685 Update docs for issue 8216 "CTFE unrelated pointer comparisons" https://github.com/D-Programming-Language/d-programming-language.org/commit/0c44eeec845dd042c64c25488cee93630ff47440 Merge pull request #130 from donc/ctfePointerCmp Update docs for issue 8216 "CTFE unrelated pointer comparisons" -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 04 2012