Index: src/asmjs/asm-wasm-builder.cc |
diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc |
index 30eb0274f925820ed0e2be154ad9535a69323307..9415a84521e2c276ff8dc319fd46fab9ff2da274 100644 |
--- a/src/asmjs/asm-wasm-builder.cc |
+++ b/src/asmjs/asm-wasm-builder.cc |
@@ -714,11 +714,13 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> { |
Literal* name = prop->key()->AsLiteral(); |
DCHECK_NOT_NULL(name); |
DCHECK(name->IsPropertyName()); |
- const AstRawString* raw_name = name->AsRawPropertyName(); |
+ Handle<String> function_name = name->AsPropertyName(); |
+ int length; |
+ std::unique_ptr<char[]> utf8 = function_name->ToCString( |
titzer
2016/12/07 16:19:18
Mmmm, I think this might be a dangling reference..
bradn
2016/12/08 08:50:24
ExportAs converts the Vector<char> to a ZoneVector
|
+ DISALLOW_NULLS, FAST_STRING_TRAVERSAL, &length); |
if (var->is_function()) { |
WasmFunctionBuilder* function = LookupOrInsertFunction(var); |
- function->ExportAs({reinterpret_cast<const char*>(raw_name->raw_data()), |
- raw_name->length()}); |
+ function->ExportAs({utf8.get(), length}); |
} |
} |
} |