Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit efb56ee

Browse files
committed
give an error on invalid characters in EM_ASM
1 parent 7c70fc6 commit efb56ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Target/JSBackend/JSBackend.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ namespace {
374374
const Constant *CI = cast<GlobalVariable>(V)->getInitializer();
375375
const ConstantDataSequential *CDS = cast<ConstantDataSequential>(CI);
376376
std::string code = CDS->getAsString();
377+
if (code.find('"') != std::string::npos) {
378+
errs() << "asm const: " << code.c_str() << "\n";
379+
error("cannot have \" characters in EM_ASM, use single-quotes (') instead");
380+
}
377381
unsigned id = AsmConsts.size();
378382
AsmConsts[code] = id;
379383
return id;

0 commit comments

Comments
 (0)