<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:sliftist@gmail.com" title="Quentin Brooks <sliftist@gmail.com>"> <span class="fn">Quentin Brooks</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - throw of a C string is causing an error when targeting wasm32"
href="https://bugs.llvm.org/show_bug.cgi?id=45171">bug 45171</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - throw of a C string is causing an error when targeting wasm32"
href="https://bugs.llvm.org/show_bug.cgi?id=45171#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - throw of a C string is causing an error when targeting wasm32"
href="https://bugs.llvm.org/show_bug.cgi?id=45171">bug 45171</a>
from <span class="vcard"><a class="email" href="mailto:sliftist@gmail.com" title="Quentin Brooks <sliftist@gmail.com>"> <span class="fn">Quentin Brooks</span></a>
</span></b>
<pre>Thanks Heejin for taking a look! I did some more testing and I think my repro
was actually not specific enough.
I think the actual bug is that clang 9 is now using "typeinfo"s for types that
are thrown, where clang 8 did not. My corrected example (works on clang 8,
doesn't on clang 9) would be:
clang --target=wasm32 -nostdlib -H -Wl,--no-entry -Wl,--allow-undefined
-Wl,--export-dynamic -fvisibility=hidden ./test.cpp
./test.cpp
extern "C" {
void* __cxa_allocate_exception(unsigned int thrown_size) { return
nullptr; }
void __cxa_throw(void* thrown_object, void* type, void(*dest)(void*)) {
}
}
__attribute__((visibility("default"))) void testThrow() {
throw "test";
}
It seems that if exceptions require "typeinfo for char const*", it should be
moved out of libc++abi and into clang. I feel like exceptions are more part of
the language, and less a standard library thing, but maybe I'm wrong.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>