[libcxx-commits] [PATCH] D63059: Implements multiline regex support

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 11 11:53:00 PDT 2020

ldionne added a comment.

In D63059#1915624 <https://reviews.llvm.org/D63059#1915624>, @Mordante wrote:

> @mclow.lists, @ldionne is the change of the size of `__l_anchor` an ABI break?

Yes, I think it is. Imagine a program compiled with an old version of libc++ (which assumes that `__l_anchor` doesn't have a `bool`) which creates a `regex` with a `__l_anchor` node in it, and then passes that regex to a shared library that was compiled with the new headers (which assumes `__l_anchor` has a `bool`). The new library will try to read the field which doesn't exist. This can be a problem because the `<regex>` code is free to be inlined into users programs and libraries too.

If we added a new derived class instead, I think this could solve our problem. Indeed, `__l_anchor` would stay unchanged, however we could have something like a `__multiline_l_anchor`?

The other option is that we just take that ABI break. Do we have a way of quantifying how bad it would be? What regexes would be impacted? Is it regexes with `^` or `$` used as anchors, passed through ABI boundaries? If we want to go down this route, we could also try to see what the extent of the ABI break is, i.e. if we tend to crash it's better than if we silently run and do something weird.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list