This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://url.spec.whatwg.org/#concept-ipv6-parser > Substep 7.2.2. Before this, "Increase pointer by one" is needed. > Substep 12.3. "While neither piece pointer nor swaps is zero, replace piece with the piece at pointer compress pointer + swaps and then decrease piece pointer and swaps by one." "compress pointer + swaps" must be "compress pointer + swaps - 1". And fixed "replace piece with the piece at pointer compress pointer + swaps - 1" is read, "Set piece to the value of the piece at pointer compress pointer + swaps - 1". But correct action is "Set piece to the value of the piece at pointer compress pointer + swaps - 1, then set the piece at pointer compress pointer + swaps - 1 to 0".
It does not need to be set to 0 I think, because they're all initially 0. Am I missing something? Made the other changes: https://github.com/whatwg/url/commit/a0b00b3d75be2624c14c6b9457c6bc0f93e9a39c
(In reply to comment #1) > It does not need to be set to 0 I think, because they're all initially 0. Am > I missing something? Made the other changes: > > https://github.com/whatwg/url/commit/a0b00b3d75be2624c14c6b9457c6bc0f93e9a39c As far as I understand, the process will run as following, and second piece's value stays 1. ---- After Step 5. "::1" | pointer # 0 1 2 3 4 5 6 7 [ 0, 0, 0, 0, 0, 0, 0, 0 ] | piece pointer compress pointer = null ---- After Step 6.3. "::1" | pointer # 0 1 2 3 4 5 6 7 [ 0, 0, 0, 0, 0, 0, 0, 0 ] | piece pointer | compress pointer ---- After Step 7.7. (first run of While loop) "::1" | pointer # 0 1 2 3 4 5 6 7 [ 0, 1, 0, 0, 0, 0, 0, 0 ] | piece pointer | compress pointer ---- After Step 12.2. swaps = piece pointer (2) - compress pointer (1) = 1 "::1" | pointer # 0 1 2 3 4 5 6 7 [ 0, 1, 0, 0, 0, 0, 0, 0 ] | piece pointer | compress pointer ---- At Step 12.3. (first run) swaps = 1 "::1" | pointer # 0 1 2 3 4 5 6 7 [ 0, 1, 0, 0, 0, 0, 0, 0 ] | piece pointer | compress pointer % neither piece pointer nor swaps is zero YES % replace piece with the piece at pointer compress pointer + swaps − 1 # 0 1 2 3 4 5 6 7 [ 0, 1, 0, 0, 0, 0, 0, 1 ] | piece pointer | compress pointer % decrease piece pointer and swaps by one swaps = 0 # 0 1 2 3 4 5 6 7 [ 0, 1, 0, 0, 0, 0, 0, 1 ] | piece pointer | compress pointer
Thanks for the helpful illustration. My intent with "replace" was "swap". So effectively you put the 1 where the 0 is, and the 0 where the 1 is. If I use the word "swap", do you think that's clear enough? (Sorry for the late reply, I've been moving countries, and overall IPv6 does not make me happy.)
(In reply to comment #3) > Thanks for the helpful illustration. My intent with "replace" was "swap". So > effectively you put the 1 where the 0 is, and the 0 where the 1 is. If I use > the word "swap", do you think that's clear enough? Yes, "swap" is much clear for me. On programming context, for example, Java's and JavaScript's String.replace, only receiver is changed. On the other hand, x86's bswap and C++'s std::swap means exchange. > (Sorry for the late reply, I've been moving countries, and overall IPv6 does > not make me happy.) I saw your article, I pray you have a good time in Mozilla.
https://github.com/whatwg/url/commit/2e081cea56ec12a3fc1bd9d4d7ba1aad93c23859
Thank you!