Uploaded image for project: 'Swift'
  1. Swift
  2. SR-4432

EXC_BAD_ACCESS on devices if nested structs are used with Xcode 8.3 and Swift 3.1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
    • Environment:

      Xcode 8.3 (8E162)
      Swift 3.1

      Description

      Hey guys!

      Like I wrote in the title, I got an EXC_BAD_ACCESS on device if nested structs are used with Xcode 8.3 and Swift 3.1. It was working properly with Xcode 8.2.1

      I've attached an example project so you guys can test it.

      My thought is that there is a problem with allocating memory for more than 4 level nested structs.
      It's confirmed that the problem appears if the struct is larger than 4K in base of Slava Pestov answer:
      "It looks like if the struct is larger than 4K we sometimes emit an incorrect instruction sequence. r31 inside an add instruction is interpreted as the zero register and not as the stack pointer."

      Looking forward to your replay, cheers!

      Carmelo

        Attachments

          Activity

            People

            Assignee:
            slavapestov Slava Pestov
            Reporter:
            carmelo.gallo Carmelo Gallo
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: