Bug 175809 - Make generate_offset_extractor.rb architectures argument more robust
Summary: Make generate_offset_extractor.rb architectures argument more robust
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-21 19:57 PDT by Keith Miller
Modified: 2017-08-21 20:20 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.69 KB, patch)
2017-08-21 19:59 PDT, Keith Miller
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2017-08-21 19:57:13 PDT
Make generate_offset_extractor.rb architetures argument more robust
Comment 1 Keith Miller 2017-08-21 19:59:23 PDT
Created attachment 318726 [details]
Patch
Comment 2 Joseph Pecoraro 2017-08-21 20:04:16 PDT
Comment on attachment 318726 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=318726&action=review

> Source/JavaScriptCore/ChangeLog:3
> +        Make generate_offset_extractor.rb architetures argument more robust

Typo in bug name: architetures

> Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb:42
> -validBackends = canonicalizeBackendNames(ARGV.shift.split(","))
> +validBackends = canonicalizeBackendNames(ARGV.shift.split(/,+\s*|\s+/))

How about:

    /[,\s]+/

This to require any combination of spaces and commas. Your regex supports leading commands and trailing whitespace but not emptiness in-between, which seems weird.
Comment 3 Keith Miller 2017-08-21 20:06:57 PDT
Comment on attachment 318726 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=318726&action=review

>> Source/JavaScriptCore/ChangeLog:3
>> +        Make generate_offset_extractor.rb architetures argument more robust
> 
> Typo in bug name: architetures

Whoops fixed.

>> Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb:42
>> +validBackends = canonicalizeBackendNames(ARGV.shift.split(/,+\s*|\s+/))
> 
> How about:
> 
>     /[,\s]+/
> 
> This to require any combination of spaces and commas. Your regex supports leading commands and trailing whitespace but not emptiness in-between, which seems weird.

Yeah, that's a better Regex! I'll change.
Comment 4 Keith Miller 2017-08-21 20:19:55 PDT
Committed r221000: <http://trac.webkit.org/changeset/221000>
Comment 5 Radar WebKit Bug Importer 2017-08-21 20:20:57 PDT
<rdar://problem/34006009>