@@ -220,7 +220,8 @@ class Mode(Enum):
220
220
class EmccState :
221
221
def __init__ (self , args ):
222
222
self .mode = Mode .COMPILE_AND_LINK
223
- self .orig_args = args
223
+ # Using tuple here to prevent accidental mutation
224
+ self .orig_args = tuple (args )
224
225
self .has_dash_c = False
225
226
self .has_dash_E = False
226
227
self .has_dash_S = False
@@ -791,13 +792,9 @@ def array_contains_any_of(hay, needles):
791
792
if n in hay :
792
793
return True
793
794
794
- # relaxed-simd implies simd128.
795
- if '-mrelaxed-simd' in user_args :
796
- user_args += ['-msimd128' ]
797
-
798
795
if array_contains_any_of (user_args , SIMD_INTEL_FEATURE_TOWER ) or array_contains_any_of (user_args , SIMD_NEON_FLAGS ):
799
- if '-msimd128' not in user_args :
800
- exit_with_error ('Passing any of ' + ', ' .join (SIMD_INTEL_FEATURE_TOWER + SIMD_NEON_FLAGS ) + ' flags also requires passing -msimd128!' )
796
+ if '-msimd128' not in user_args and '-mrelaxed-simd' not in user_args :
797
+ exit_with_error ('Passing any of ' + ', ' .join (SIMD_INTEL_FEATURE_TOWER + SIMD_NEON_FLAGS ) + ' flags also requires passing -msimd128 (or -mrelaxed-simd) !' )
801
798
cflags += ['-D__SSE__=1' ]
802
799
803
800
if array_contains_any_of (user_args , SIMD_INTEL_FEATURE_TOWER [1 :]):
@@ -1255,7 +1252,7 @@ def phase_parse_arguments(state):
1255
1252
"""The first phase of the compiler. Parse command line argument and
1256
1253
populate settings.
1257
1254
"""
1258
- newargs = state .orig_args . copy ( )
1255
+ newargs = list ( state .orig_args )
1259
1256
1260
1257
# Scan and strip emscripten specific cmdline warning flags.
1261
1258
# This needs to run before other cmdline flags have been parsed, so that
0 commit comments