[PATCH] D48052: [sanitizer] Don't treat colon before slash as a flag separator

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 12:04:23 PDT 2018


vitalybuka accepted this revision.
vitalybuka added a comment.
This revision is now accepted and ready to land.

works for me any way



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cc:77
+  // path separator. This avoids common portability issues when an unquoted
+  // Windows path is used, as in 'symbolizer_path=C:/foo/llvm-symbolizer.exe'.
+  // Since no option names should start with / or \, it should be unambiguous.
----------------
rnk wrote:
> vitalybuka wrote:
> > All these variables are mapped to the same C++ members. So not sure if it's worth it but what if we generalize to:
> > ":" is separateor IFF it's followed by "[a-zA_Z0-9_]+="
> > 
> I think that'll be too magic. Consider this case where the user just forgets to say "flag2" before "=":
>   flag1=val1:=val2:flag3=val3
> 
> We'll parse that as flag1="val1:=val2" and not give any errors. The same could be said with this if they add a slash after a colon that's supposed to be a separator, but hopefully it's not an issue in practice.
Both approaches too magic but one can avoid OS specifics.
To get error there we can just use "[a-zA_Z0-9_]*=" and it will hit same error :-)

BTW. The patch does not cover "c:win\path" which is impractical but valid path.


https://reviews.llvm.org/D48052





More information about the llvm-commits mailing list