This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Support VPtr sanitizer for Emscripten
ClosedPublic

Authored by quantum on May 28 2019, 4:54 PM.

Details

Summary

After https://github.com/emscripten-core/emscripten/pull/8651, Emscripten
supports the full UBSan runtime. This includes the VPtr sanitizer.

This diff allows clang to generate code that uses the VPtr sanitizer for
Emscripten.

Diff Detail

Repository
rL LLVM

Event Timeline

quantum created this revision.May 28 2019, 4:54 PM
aheejin added inline comments.May 28 2019, 5:35 PM
clang/lib/Driver/ToolChains/WebAssembly.cpp
214 ↗(On Diff #201789)

Does this mean we only support Vptr among sanitizers here?

Please add a test!

quantum marked 2 inline comments as done.May 28 2019, 5:44 PM
quantum added inline comments.
clang/lib/Driver/ToolChains/WebAssembly.cpp
214 ↗(On Diff #201789)

No, by default all of UBSan except Vptr and Function are declared as supported. This adds Vptr to the list as it's supported on Emscripten.

aheejin added inline comments.May 28 2019, 6:01 PM
clang/lib/Driver/ToolChains/WebAssembly.cpp
214 ↗(On Diff #201789)

I see. By the way where do we say we support the undefined sanitizer group?

quantum updated this revision to Diff 201803.May 28 2019, 6:09 PM
quantum marked an inline comment as done.

Add a test

quantum marked 2 inline comments as done.May 28 2019, 6:11 PM
quantum added inline comments.
clang/lib/Driver/ToolChains/WebAssembly.cpp
214 ↗(On Diff #201789)

The base ToolChain class says it's supported on all platforms.

aheejin added inline comments.May 28 2019, 6:12 PM
clang/lib/Driver/ToolChains/WebAssembly.cpp
214 ↗(On Diff #201789)

By the way this seems to include Vptr as well..? Am I looking at the wrong place?

aheejin added inline comments.May 28 2019, 6:14 PM
clang/lib/Driver/ToolChains/WebAssembly.cpp
214 ↗(On Diff #201789)

Oh nevermind, the base method explicitly excludes Vptr and Function.

quantum marked 3 inline comments as done.May 28 2019, 6:18 PM
aheejin accepted this revision.May 28 2019, 6:19 PM
This revision is now accepted and ready to land.May 28 2019, 6:19 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2019, 11:30 AM