Skip to content

Commit 9e5726d

Browse files
committed
fix: override of SSE is done before platform/arch check
1 parent 3887e8d commit 9e5726d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ts/node/sharp_support/sharpSupport.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ function overrideSSE42IsSupported() {
2121
* Checks from /proc/cpuinfo if the CPU supports SSE 4.2 instructions.
2222
*/
2323
function sse42FromCPUInfo() {
24-
const sse42Override = overrideSSE42IsSupported();
25-
if (sse42Override !== null) {
26-
return sse42Override;
27-
}
2824
try {
2925
const cpuinfo = readFileSync('/proc/cpuinfo', 'utf8');
3026
const flagsMatch = cpuinfo.match(/flags\s*:\s*(.+)/m);
@@ -53,6 +49,10 @@ function isLinuxX64() {
5349
* This function checks if we are on linux x64 and if yes, checks `/proc/cpuinfo` for the SSE 4.2 flag.
5450
*/
5551
export function isSharpSupported() {
52+
const sse42Override = overrideSSE42IsSupported();
53+
if (sse42Override !== null) {
54+
return sse42Override;
55+
}
5656
if (isLinuxX64()) {
5757
return sse42FromCPUInfo();
5858
}

0 commit comments

Comments
 (0)