Commit 058f1887 authored by titzer's avatar titzer Committed by Commit bot

[wasm] Only SNPrintF the function index if a name was not supplied.

R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2590833002
Cr-Commit-Position: refs/heads/master@{#41863}
parent 081ac370
......@@ -326,10 +326,10 @@ Handle<WasmExportedFunction> WasmExportedFunction::New(
Isolate* isolate, Handle<WasmInstanceObject> instance,
MaybeHandle<String> maybe_name, int func_index, int arity,
Handle<Code> export_wrapper) {
ScopedVector<char> buffer(16);
int length = SNPrintF(buffer, "%d", func_index);
Handle<String> name;
if (maybe_name.is_null()) {
EmbeddedVector<char, 16> buffer;
int length = SNPrintF(buffer, "%d", func_index);
name = isolate->factory()
->NewStringFromAscii(
Vector<const char>::cast(buffer.SubVector(0, length)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment