Skip to content

avoid segmentation fault on accessing un-initialized struct field#45

Merged
wf001 merged 1 commit into
devfrom
feature/avoid-segmentation-fault-on-accessing-uninitialized-strcut-field
May 19, 2025
Merged

avoid segmentation fault on accessing un-initialized struct field#45
wf001 merged 1 commit into
devfrom
feature/avoid-segmentation-fault-on-accessing-uninitialized-strcut-field

Conversation

@wf001
Copy link
Copy Markdown
Owner

@wf001 wf001 commented May 19, 2025

What’s this PR?

What’s changed?

By using phi, avoid segmentation fault on the situation:

(defschema Country {
                    :name :: string
                  })

(defschema Person {
                   :name :: string
                   :country :: Country})

(def main :: int
  (fn []
    (let [co :: Country {:name "deutsch"}
          person :: Person {:name "jimmy"}]
      (prn (get (get person :country) :name))
      )))

Anything else?

@wf001 wf001 merged commit b0ac300 into dev May 19, 2025
1 check passed
@wf001 wf001 deleted the feature/avoid-segmentation-fault-on-accessing-uninitialized-strcut-field branch May 19, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant