Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Issue 2808107: Leftovers from wstring->string16 conversion in authentication code. (Closed)

Created:
10 years, 4 months ago by cbentzel
Modified:
9 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Leftovers from wstring->string16 conversion in authentication code. I'm really confused how this even compiled in the first case (such as the npos comparison). BUG=50517 TEST=net_unittests, tested on Ubuntu against NTLM server + proxy. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=55109

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -2 lines) Patch
M net/http/http_auth_handler_ntlm.cc View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
cbentzel
10 years, 4 months ago (2010-08-05 18:21:28 UTC) #1
cbentzel
Oh, yeah, npos is just a size_t. Anyway, I'm now confused why the find was ...
10 years, 4 months ago (2010-08-05 18:24:29 UTC) #2
Lei Zhang
LGTM I too am surprised that code compiled.
10 years, 4 months ago (2010-08-05 18:45:37 UTC) #3
cbentzel
Yeah. I'm going to spend a tiny bit of time figuring it out as it ...
10 years, 4 months ago (2010-08-05 18:50:49 UTC) #4
cbentzel
10 years, 4 months ago (2010-08-05 21:33:26 UTC) #5
The original disassembly at the call site (in debug build) was 

41	  size_t backslash_idx = username->find(L'\\');
   0x00007ffff656f5d2 <+90>:	mov    -0x3b0(%rbp),%rax
   0x00007ffff656f5d9 <+97>:	mov    $0x0,%edx
   0x00007ffff656f5de <+102>:	mov    $0x5c,%esi
   0x00007ffff656f5e3 <+107>:	mov    %rax,%rdi
=> 0x00007ffff656f5e6 <+110>:	callq  0x7ffff67474d0
<_ZNKSbItN4base20string16_char_traitsESaItEE4findEtm@plt>
   0x00007ffff656f5eb <+115>:	mov    %rax,-0x68(%rbp)

The mov $0x5c,%esi line is where the wchar_t literal L'\\' is copied to a
register. Maybe this is a conversion case where it knows the upper 16-bits are 0
(and actually, the upper 24-bits are 0) so this is acceptable.

Powered by Google App Engine
This is Rietveld 408576698