[PATCH] D51608: [modules] when deserializing method, ensure it has correct exception spec

Steve O'Brien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 3 20:29:13 PDT 2018


elsteveogrande created this revision.
elsteveogrande added reviewers: rsmith, dblaikie.
Herald added a subscriber: cfe-commits.

(PR38627)

After deserializing, the `PendingExceptionSpecUpdates` table is iterated over to apply exception specs to functions.  There may be `EST_None`-type in this table.  However if there is a method in the redecl chain already having some other non-`EST_None` type, this should not be clobbered with none.

If we see `EST_None` avoid setting the exception spec.  (This is the default anyway, so it's safe to skip in the legit case.)

There may be *better* ways to actually fix this, rather than a simple 1-line defensive check like I did here.  It would be more complicated and quite outside my area of experience though.

Test Plan: Passes `ninja check-clang`, including a new test case.

Andrew Gallagher provided the test case (distilling it from a much more complex instance in our code base).


Repository:
  rC Clang

https://reviews.llvm.org/D51608

Files:
  lib/Serialization/ASTReader.cpp
  test/Modules/Inputs/PR38627/a.h
  test/Modules/Inputs/PR38627/module.modulemap
  test/Modules/pr38627.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51608.163755.patch
Type: text/x-patch
Size: 3379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180904/1e89c76b/attachment.bin>


More information about the cfe-commits mailing list