Fix misuse of ArrayRef
@gbaned Thanks for triggering the ARM_CI run on this PR. Unfortunately it failed due to an unrelated API change issue. I have just rebased the code to pick up the fix for the API change. @GleasonK Please could you review this again now?
Fix some uses of ArrayRef that result in out of scope accesses being made. This includes accesses on the stack after being freed. Also fixed a concat attempt of two arrays through ArrayRef that was producing nonsense.
The issues were located with the address sanitizer and shown to be fixed with these changes.