This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Lower ASan constructor priority on Emscripten
ClosedPublic

Authored by quantum on Aug 2 2019, 5:23 PM.

Details

Summary

This change gives Emscripten the ability to use more than one constructor
priorities that runs before ASan. By convention, constructor priorites 0-100
are reserved for use by the system. ASan on Emscripten now uses priority 50,
leaving plenty of room for use by Emscripten before and after ASan.

This change is done in response to:
https://github.com/emscripten-core/emscripten/pull/9076#discussion_r310323723

Diff Detail

Repository
rL LLVM

Event Timeline

quantum created this revision.Aug 2 2019, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2019, 5:23 PM
quantum edited the summary of this revision. (Show Details)Aug 2 2019, 5:23 PM
quantum edited the summary of this revision. (Show Details)
tlively added inline comments.Aug 5 2019, 11:31 AM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
1780 ↗(On Diff #213148)

You probably don't need a variable here since the value is only used once and the function name is plenty descriptive.

2444 ↗(On Diff #213148)

How about renaming this Priority or similar since there is a lot of repeated information otherwise?

sbc100 added inline comments.Aug 5 2019, 11:56 AM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
132 ↗(On Diff #213148)

Any reason not to change this for all platforms? In any case an explaining comment might be a good idea here.

quantum updated this revision to Diff 213445.Aug 5 2019, 12:59 PM
quantum marked 4 inline comments as done.

Apply suggestions.

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
132 ↗(On Diff #213148)

I suspect doing that will break things on other platforms. I shall add a comment.

tlively accepted this revision.Aug 6 2019, 1:04 PM

It would be good to add a test here, too ;)

This revision is now accepted and ready to land.Aug 6 2019, 1:04 PM
quantum updated this revision to Diff 213720.Aug 6 2019, 2:15 PM

Add constructor priority test

Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2019, 2:15 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision was automatically updated to reflect the committed changes.
sbc100 added inline comments.Aug 6 2019, 5:20 PM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
132 ↗(On Diff #213148)

I think it might be a good idea to contact the original author to find out why 1 was chosen here and if they think it would be OK to change to 50 across the board.