[PATCH] D90714: [clang]Fix length threshold for MicrosoftMangle md5 hash

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 16:33:11 PST 2020


dblaikie added a comment.

In D90714#2379785 <https://reviews.llvm.org/D90714#2379785>, @mibintc wrote:

> you're right about the regex syntax. i think the 4088 is over the max repetition count and there's also a problem with balanced. not sure what i did wrong here. if you have a chance to look at this otherwise i'll toil over the weekend, i'm off for the day--cheers.  here's what i'm trying now just to see if it would work.  can i nest repetition counts?
>
>   63:20: error: invalid regex: braces not balanced
>   // CHECK-DAG: @"?{{\(z\){255}}}@@3HA" = dso_local global i32 1515, align 4
>
> i also tried it without the parens around z or with parens around z but not backslash.

Ah, the mismatched braces is from the }}} at the end, I think the first two }} are ending the regex (& then the regex contains an open { without a close). That's why I included the @@3HA inside the regex match in my example/first guess.

Let's see what I can come up with. Ah, yeah, seems there's a limit of 255 <https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/regcomp.c#L279>.

I guess the thing to do would be to just * map the 'z' 'knowing' it'll be the number of zs in the macro, while still demonstrating the extra characters that get up to the precise length the test is intended to exercise.

  // CHECK-DAG: @"?{{z+}}@@3HA" = dso_local global i32 1515, align 4


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90714/new/

https://reviews.llvm.org/D90714



More information about the cfe-commits mailing list