diff --git a/scripts/verify/baselines/resource-constraint-constructor.json b/scripts/verify/baselines/resource-constraint-constructor.json index 5b1c865ee9..629b2557a7 100644 --- a/scripts/verify/baselines/resource-constraint-constructor.json +++ b/scripts/verify/baselines/resource-constraint-constructor.json @@ -109,7 +109,7 @@ "src/native/NativePlistSource.ts": 2, "src/native/SignatureTargetBinding.ts": 1, "src/native/apple/AppleIpsProvider.ts": 1, - "src/native/elf/ElfUnwindRangesProvider.ts": 2, + "src/native/elf/ElfUnwindRangesProvider.ts": 1, "src/native/elf/KernelBuildConfigProvider.ts": 1, "src/native/elf/KernelModuleProvider.ts": 1, "src/native/exports/NativeExportsProvider.ts": 1, diff --git a/src/native/elf/ElfUnwindRangesProvider.ts b/src/native/elf/ElfUnwindRangesProvider.ts index aa935cf442..1e58dc13d0 100644 --- a/src/native/elf/ElfUnwindRangesProvider.ts +++ b/src/native/elf/ElfUnwindRangesProvider.ts @@ -103,23 +103,18 @@ const elfUnwindFailurePrimary = ( if (origin === "owned-or-classified" && cause instanceof AnalysisError) return cause; if (isParseLimit(cause, ELF_UNWIND_FORMAT)) { - const { detail, limit } = cause.failure; + const { limit } = cause.failure; const records = limit.name === ELF_UNWIND_RECORD_LIMIT; - return new AnalysisResourceConstraintError( - OPERATION, - "capacity", - detail, - records - ? { max_file_bytes: input.max_file_bytes, max_ranges: limit.maximum } - : { limit: input.limit, maximum_bytes: limit.maximum }, - { - cause, - retryable: false, - remediationAction: records - ? recordBudgetRemediation(limit.maximum) - : `Request a smaller limit than ${String(input.limit)}, or page with offset; the ${String(limit.maximum)}-byte symbol-name text allowance is fixed, and max_ranges and max_file_bytes do not raise it.`, - }, - ); + return parseLimitConstraint(OPERATION, "capacity", cause, { + legacyMaximumKey: records ? "max_ranges" : "maximum_bytes", + reportedLimitContext: records + ? { max_file_bytes: input.max_file_bytes } + : { limit: input.limit }, + retryable: false, + remediationAction: records + ? recordBudgetRemediation(limit.maximum) + : `Request a smaller limit than ${String(input.limit)}, or page with offset; the ${String(limit.maximum)}-byte symbol-name text allowance is fixed, and max_ranges and max_file_bytes do not raise it.`, + }); } if (cause instanceof BinaryResourceFailure) return parseLimitConstraint(