{"action":"opened","issue":{"url":"https://api.github.com/repos/tomhrr/dale/issues/37","labels_url":"https://api.github.com/repos/tomhrr/dale/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/tomhrr/dale/issues/37/comments","events_url":"https://api.github.com/repos/tomhrr/dale/issues/37/events","html_url":"https://github.com/tomhrr/dale/issues/37","id":68530401,"number":37,"title":"Segmentation fault with (@:@ <DNode> list-node) -- Add safer compile time execution?","user":{"login":"BitPuffin","id":657581,"avatar_url":"https://avatars.githubusercontent.com/u/657581?v=3","gravatar_id":"","url":"https://api.github.com/users/BitPuffin","html_url":"https://github.com/BitPuffin","followers_url":"https://api.github.com/users/BitPuffin/followers","following_url":"https://api.github.com/users/BitPuffin/following{/other_user}","gists_url":"https://api.github.com/users/BitPuffin/gists{/gist_id}","starred_url":"https://api.github.com/users/BitPuffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BitPuffin/subscriptions","organizations_url":"https://api.github.com/users/BitPuffin/orgs","repos_url":"https://api.github.com/users/BitPuffin/repos","events_url":"https://api.github.com/users/BitPuffin/events{/privacy}","received_events_url":"https://api.github.com/users/BitPuffin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-14T23:55:19Z","updated_at":"2015-04-14T23:55:19Z","closed_at":null,"body":"``` racket\r\n(import macros)\r\n(import cstdio)\r\n(import introspection)\r\n\r\n(using-namespace std.macros\r\n  (def def-type-macro (macro extern (new linkage old)\r\n    (setv old (@:@ old list-node))\r\n    (qq using-namespace std.macros\r\n      (def (uq new) (macro (uq linkage) (void)\r\n        (qq (uql old))))))))\r\n\r\n(def-type-macro cstring extern (p (const char)))\r\n(def-type-macro boob extern int) ; this line causes segfault\r\n\r\n(def main (fn extern-c void (void)\r\n  (def a-string (var auto (cstring) \"Yo dude\"))\r\n  (printf \"string: %s\\n\" a-string)\r\n  (return)))\r\n```\r\n\r\nI'm not sure if this should be considered a bug or not. It makes sense that trying to access the memory when it's not actually there would cause a segfault. However it feels like especially at compile time you don't want segmentation fault to be your only hint that something is wrong. So I think there needs to eventually be some solution that does checking at compile time that you aren't accessing memory you don't own. And report which line that causes the segmentation fault."}}