[Wasm] Disable range checks for arrays. Add cli argument to enable them back.
This commit is contained in:
+3
@@ -253,6 +253,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xwasm-kclass-fqn", description = "Enable support for FQ names in KClass")
|
||||
var wasmKClassFqn: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(value = "-Xwasm-enable-array-range-checks", description = "Turn on range checks for the array access functions")
|
||||
var wasmEnableArrayRangeChecks: Boolean by FreezableVar(false)
|
||||
|
||||
override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> {
|
||||
return super.configureAnalysisFlags(collector, languageVersion).also {
|
||||
it[allowFullyQualifiedNameInKClass] = wasm && wasmKClassFqn //Only enabled WASM BE supports this flag
|
||||
|
||||
@@ -135,6 +135,8 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
|
||||
configuration.put(JSConfigurationKeys.PARTIAL_LINKAGE, arguments.partialLinkage)
|
||||
|
||||
configuration.put(JSConfigurationKeys.WASM_ENABLE_ARRAY_RANGE_CHECKS, arguments.wasmEnableArrayRangeChecks)
|
||||
|
||||
val commonSourcesArray = arguments.commonSources
|
||||
val commonSources = commonSourcesArray?.toSet() ?: emptySet()
|
||||
for (arg in arguments.freeArgs) {
|
||||
|
||||
Reference in New Issue
Block a user