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

Issue 15948004: Fix a case 'submatched_dict' may include a key with None value. (Closed)

Created:
7 years, 6 months ago by Dai Mikurube (NOT FULLTIME)
Modified:
7 years, 6 months ago
Reviewers:
peria
CC:
chromium-reviews, dennis_jeffrey, anantha, dmikurube+memory_chromium.org, dyu1
Visibility:
Public.

Description

Fix a case 'submatched_dict' may include a key with None value. BUG=None NOTRY=True TBR=peria@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202808

Patch Set 1 #

Patch Set 2 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M tools/deep_memory_profiler/dmprof.py View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Dai Mikurube (NOT FULLTIME)
Committed patchset #2 manually as r202808 (presubmit successful).
7 years, 6 months ago (2013-05-29 07:56:39 UTC) #1
Dai Mikurube (NOT FULLTIME)
Sorry for TBR. It's a quick fix in the script.
7 years, 6 months ago (2013-05-29 08:04:53 UTC) #2
peria
LGTM for quick fix. However, please consider if Dump._map's elements (region_info[]) can have 'None' in ...
7 years, 6 months ago (2013-05-29 08:13:08 UTC) #3
Dai Mikurube (NOT FULLTIME)
Thanks! I thought it doesn't happen since "submatched_dict.get(...)" is evaluated as False if it's None ...
7 years, 6 months ago (2013-05-29 08:34:05 UTC) #4
peria
On 2013/05/29 08:34:05, Dai Mikurube wrote: > Thanks! > > I thought it doesn't happen ...
7 years, 6 months ago (2013-05-29 08:48:58 UTC) #5
Dai Mikurube (NOT FULLTIME)
7 years, 6 months ago (2013-05-29 08:58:08 UTC) #6
Message was sent while issue was closed.
On 2013/05/29 08:48:58, peria wrote:
> On 2013/05/29 08:34:05, Dai Mikurube wrote:
> > Thanks!
> > 
> > I thought it doesn't happen since "submatched_dict.get(...)" is evaluated as
> > False if it's None in Python.  Tell me if it's wrong.
> > ('vma' can have it looking at the script, but we can assume it doesn't
> happen.)
> 
> Yes, it's true.
> But if other routines can work with None values,
> code can be less buggy and the routine in this CL can be simple.
> 
> (I'm not sure how dirty code "if not value:" branches can make ;)

Makes sense.  Ok, I'll try to fix it.  Thanks!
(The actual immediate problem here was that ".strip()" fails if
"submatched_dict['TYPE']" is None. We need this check in either case.)

Powered by Google App Engine
This is Rietveld 408576698