Skip to content

Commit fc97a98

Browse files
committed
do not kill asm library functions with DEAD_FUNCTIONS, as they perform fundamental things we cannot easily remove, and there are not many of them anyhow; fixes asm1.test_asm_pgo
1 parent b6d2f10 commit fc97a98

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/jsifier.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,13 @@ function JSify(data, functionsOnly, givenFunctions) {
491491
// If this is not linkable, anything not in the library is definitely missing
492492
var cancel = false;
493493
if (item.ident in DEAD_FUNCTIONS) {
494-
LibraryManager.library[shortident] = new Function("Module['printErr']('dead function: " + shortident + "'); abort(-1);");
495-
delete LibraryManager.library[shortident + '__inline'];
496-
delete LibraryManager.library[shortident + '__deps'];
494+
if (LibraryManager.library[shortident + '__asm']) {
495+
warn('cannot kill asm library function ' + item.ident);
496+
} else {
497+
LibraryManager.library[shortident] = new Function("Module['printErr']('dead function: " + shortident + "'); abort(-1);");
498+
delete LibraryManager.library[shortident + '__inline'];
499+
delete LibraryManager.library[shortident + '__deps'];
500+
}
497501
}
498502
if (!LINKABLE && !LibraryManager.library.hasOwnProperty(shortident) && !LibraryManager.library.hasOwnProperty(shortident + '__inline')) {
499503
if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + shortident);

0 commit comments

Comments
 (0)