[Bitcode] Diagnose errors instead of asserting from bad input