Skip to content

Constructing invalid dates can lead to infinite recursion #4132

@alan-knight

Description

@alan-knight

I ran into this attempting to naively just parse back whatever we had generated for a date format. One of the valid date formats is just "day". So January 27, 2012, prints as "27". That ends up in an infinite recursion if you parse it. As does

main() {
  var x = new Date(0,0,27,0,0,0,0,false);
  print(x);
}

That's not, I think, a representable date if we're counting from 1970, but it still shouldn't crash the VM.

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.closed-obsoleteClosed as the reported issue is no longer relevant

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions