Our DNA is written in Objective-C
Jump

LLVM Crash

I found this LLVM compiler crash when updating a project for building with Xcode 8. At first I thought it had to do with #if DEBUG because the crash didn’t occur when I removed the conditional compiling block. But further experimentation showed that it is a specific line in this block that is causing the issue.

It is filed as rdar://28318984 and on Open Radar.

BSA Banner

Summary

The Xcode editor accepts the mentioned code as valid, but LLVM on building seg-faults.

Steps to Reproduce

Paste this line into a single-view iOS app:

try! JSONSerialization.data(withJSONObject: !, options: [])

Expected Results

  • Both the Xcode syntax checker as well as LLVM should report the parameter as invalid.

Actual Results

  • Xcode editor accepts the code as stated
  • LLVM seg-faults (see attached screenshot)

Version

Version 8.0 (8A218a), macOS 10.11.6 (15G31)

Notes

Might be coming from the first parameter’s type gotten changed to an Any in the the Grand Renaming. But it is a mystery to me why ! would be a valid Any.

LLVM Crash


Also published on Medium.


Categories: Bug Reports

Leave a Comment

%d bloggers like this: