yanagiba / swift-ast

A Swift AST parser and visitor that is written in Swift.
Apache License 2.0
355 stars 40 forks source link

Lexer crash with illegal instruction when parsing swift file with very long integers #67

Open notorca opened 6 years ago

notorca commented 6 years ago

I'm trying to parse tests form upstream swift repository and with swift-ast and found a crash of files https://github.com/apple/swift/blob/master/test/SILOptimizer/diagnostic_constant_propagation_int.swift and https://github.com/apple/swift/blob/master/test/SILOptimizer/diagnostic_constant_propagation.swift This files are also attached in the archive.

notorca commented 6 years ago

More cases: https://github.com/apple/swift/blob/master/test/stdlib/IntegerCompatibility.swift https://github.com/apple/swift/blob/master/test/stdlib/PrintPointer.swift https://github.com/apple/swift/blob/master/test/stdlib/PrintFloat.swift

dohuutamhuy commented 5 years ago

I'm having the same problem when try to parse this file: https://github.com/jpsim/Yams/blob/master/Tests/YamsTests/ConstructorTests.swift Is there a fix for this or a way to work around?