fix: prevent stale mutation execution
This commit is contained in:
@@ -100,7 +100,10 @@ static bool wasm_artifact_exists(Request* context, const String& entry_unit)
|
||||
// metadata mismatches, which can leave stale wasm with old imports.
|
||||
bool source_missing = false;
|
||||
if(compiler_unit_needs_recompile(context, entry_unit, &source_missing))
|
||||
{
|
||||
compiler_prioritize_unit(context, entry_unit);
|
||||
return(compiler_request_can_serve_stale_artifact(context));
|
||||
}
|
||||
if(source_missing)
|
||||
return(false);
|
||||
return(true);
|
||||
|
||||
+4
-1
@@ -1606,7 +1606,10 @@ private:
|
||||
return(1);
|
||||
}
|
||||
|
||||
if(!file_exists_host(worker.unit_wasm_path(resolved)) || (compiler_unit_needs_recompile(context, resolved, 0) && !compiler_request_can_serve_stale_artifact(context) && !compiler_unit_compile_in_progress(context, resolved)))
|
||||
bool stale = compiler_unit_needs_recompile(context, resolved, 0);
|
||||
if(stale && compiler_request_can_serve_stale_artifact(context))
|
||||
compiler_prioritize_unit(context, resolved);
|
||||
if(!file_exists_host(worker.unit_wasm_path(resolved)) || (stale && !compiler_request_can_serve_stale_artifact(context) && !compiler_unit_compile_in_progress(context, resolved)))
|
||||
get_shared_unit(context, resolved);
|
||||
|
||||
size_t unit_index = 0;
|
||||
|
||||
Reference in New Issue
Block a user