{"record":{"id":"dd05d143a8ed350a","repo":"NationalSecurityAgency/ghidra","slug":"invalid-min-min","errorCode":null,"errorMessage":"Invalid min: {min}","messagePattern":"Invalid min: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/FieldSpan.java","lineNumber":117,"sourceCode":"\t */\n\tstatic FieldSpan tail(Field from, boolean fromInclusive, Direction direction) {\n\t\treturn direction == Direction.FORWARD\n\t\t\t\t? DOMAIN.closed(End.lower(from, fromInclusive), End.positiveInfinity())\n\t\t\t\t: DOMAIN.closed(End.negativeInfinity(), End.upper(from, fromInclusive));\n\t}\n\n\t/**\n\t * The domain of field values, allowing open endpoints\n\t */\n\tpublic class Domain extends EndDomain<Field, FieldSpan> {\n\t\tprivate Domain() {\n\t\t\tsuper(Field::compareTo);\n\t\t}\n\n\t\t@Override\n\t\tpublic FieldSpan closed(End<Field> min, End<Field> max) {\n\t\t\tif (!min.isValidMin()) {\n\t\t\t\tthrow new IllegalArgumentException(\"Invalid min: \" + min);\n\t\t\t}\n\t\t\tif (!max.isValidMax()) {\n\t\t\t\tthrow new IllegalArgumentException(\"Invalid max: \" + max);\n\t\t\t}\n\t\t\treturn super.closed(min, max);\n\t\t}\n\n\t\t@Override\n\t\tpublic FieldSpan newSpan(End<Field> min, End<Field> max) {\n\t\t\treturn new Impl(min, max);\n\t\t}\n\n\t\t@Override\n\t\tpublic FieldSpan empty() {\n\t\t\treturn EMPTY;\n\t\t}\n\n\t\t@Override","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/FieldSpan.java#L99-L135","documentation":"FieldSpan.Domain.closed requires the min endpoint to be a valid lower bound. In the End API, POS_INF (positive infinity) returns isValidMin()==false because nothing can be greater-than-or-equal to +inf as a lower bound, so passing it as the min makes an impossible span and IllegalArgumentException is thrown.","triggerScenarios":"closed(POS_INF, ...) or any min endpoint whose isValidMin() returns false (the framework's only such builtin endpoint is positive infinity).","commonSituations":"Generic span construction that lets the wrong infinity leak into the min slot; building ranges from inverted/unbounded bounds; programmatic min/max computation returning +inf for the lower end.","solutions":["Use a finite End or NEG_INF for the min endpoint.","Validate isValidMin()/isValidMax() before calling closed() in generic code.","Reorder inverted bounds before constructing the span."],"exampleFix":"// before\nspan = domain.closed(End.POS_INF, someMax);\n// after\nspan = domain.closed(aFiniteOrNegInfMin, someMax);","handlingStrategy":"validation","validationCode":"if (!min.isValidMin()) {\n    // swap in a finite or NEG_INF min before constructing the span\n    return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In generic span-building code, always validate isValidMin()/isValidMax() before calling closed().","Avoid passing POS_INF as a minimum endpoint."],"tags":["range","validation","data-structure"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}