-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to fix potential compiler segfault in lookup.c #4191
base: main
Are you sure you want to change the base?
Commits on Jul 27, 2022
-
Fix for crash involving the use of private types used as default values
This attempts to fix issues ponylang#4130 and ponylang#4153. The issue was when a private type in another package was used as a default value in a method call. Fix to ponylang#4130 Since it has been decided to treat this as a bug instead of a missing error, this PR implements the fix suggested by @ergl, namely using `lookup_try()` instead of lookup() in call.c's `check_partial_function_call()` since it allows to permit private types. Fix to ponylang#4153 This is also a simply fix to lookup.c that prevents a potential segfault by a dereferencing of `opt` (`typecheck_t* t = &opt->check;`) *before* `opt != NULL` was checked. As pointed out by @SeanTAllen, opt should not be NULL to begin with when lookup_nominal is called, and instead, an assert should be added and the NULL checks in that function removed.
Configuration menu - View commit details
-
Copy full SHA for 527864d - Browse repository at this point
Copy the full SHA 527864dView commit details -
Revert "Fix for crash involving the use of private types used as defa…
…ult values" This reverts commit 527864d.
Configuration menu - View commit details
-
Copy full SHA for 0eae6ef - Browse repository at this point
Copy the full SHA 0eae6efView commit details -
Fix for crash involving the use of private types used as default values
This attempts to fix ponylang#4130 This crash stems from the use of a private type as defined in another package when it was used as a default value in a method call. Since it has been decided to treat this as a bug instead of a missing error, this PR implements the fix suggested by @ergl, namely using `lookup_try()` instead of lookup() in call.c's `check_partial_function_call()` since the former can be configured to permit private types. Fix to ponylang#4153 This is a simply change to `lookup_nominal()` in lookup.c that prevents a potential segfault by a dereferencing of `opt` (`typecheck_t* t = &opt->check;`) *before* `opt != NULL` was checked. As pointed out by @SeanTAllen, opt should not be NULL to begin with when `lookup_nominal()` is called, and instead, an assert should be added and the NULL checks in that function removed. With this PR, the two examples below that crashed the compiler now both compile: Original example: ```pony // inside the "useful" package primitive _PrivateDefault actor Useful[A: Any val] fun tag config(value: (A | _PrivateDefault) = _PrivateDefault): Useful[A] => this // inside "main" use "useful" primitive This primitive That type Stuff is (This | That) actor Main new create(env: Env) => let u = Useful[Stuff].config() ``` Minimal example: ```pony // In the "lib" pacakge primitive _Private primitive Public fun apply[T](v: (T | _Private) = _Private): None => None // In main use lib = "lib" actor Main new create(env: Env) => let p = lib.Public.apply[U8]() env.out.print(p.string()) ```
Configuration menu - View commit details
-
Copy full SHA for 7c18b7f - Browse repository at this point
Copy the full SHA 7c18b7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6391765 - Browse repository at this point
Copy the full SHA 6391765View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fd6c26 - Browse repository at this point
Copy the full SHA 5fd6c26View commit details
Commits on Jul 28, 2022
-
Update test/libponyc-run/private-type-as-default-argument-in-public-f…
…unction/main.pony Co-authored-by: Borja o'Cook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cb3b960 - Browse repository at this point
Copy the full SHA cb3b960View commit details
Commits on Jul 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 323e371 - Browse repository at this point
Copy the full SHA 323e371View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08de6f7 - Browse repository at this point
Copy the full SHA 08de6f7View commit details
Commits on Aug 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for a7c6399 - Browse repository at this point
Copy the full SHA a7c6399View commit details -
Configuration menu - View commit details
-
Copy full SHA for 262cdb8 - Browse repository at this point
Copy the full SHA 262cdb8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f0afed - Browse repository at this point
Copy the full SHA 0f0afedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 200baea - Browse repository at this point
Copy the full SHA 200baeaView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4c5eae - Browse repository at this point
Copy the full SHA e4c5eaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43b1910 - Browse repository at this point
Copy the full SHA 43b1910View commit details
Commits on Aug 7, 2022
-
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dc2758e - Browse repository at this point
Copy the full SHA dc2758eView commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6145521 - Browse repository at this point
Copy the full SHA 6145521View commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 79cfe22 - Browse repository at this point
Copy the full SHA 79cfe22View commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d54c0b - Browse repository at this point
Copy the full SHA 5d54c0bView commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fca55f3 - Browse repository at this point
Copy the full SHA fca55f3View commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 20bd478 - Browse repository at this point
Copy the full SHA 20bd478View commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9646618 - Browse repository at this point
Copy the full SHA 9646618View commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6d19d5a - Browse repository at this point
Copy the full SHA 6d19d5aView commit details -
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d3a9a70 - Browse repository at this point
Copy the full SHA d3a9a70View commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3e80b98 - Browse repository at this point
Copy the full SHA 3e80b98View commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4a8b13a - Browse repository at this point
Copy the full SHA 4a8b13aView commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1545c6e - Browse repository at this point
Copy the full SHA 1545c6eView commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 882059c - Browse repository at this point
Copy the full SHA 882059cView commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 533fb92 - Browse repository at this point
Copy the full SHA 533fb92View commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 65be1ce - Browse repository at this point
Copy the full SHA 65be1ceView commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 136ff80 - Browse repository at this point
Copy the full SHA 136ff80View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ee68fa - Browse repository at this point
Copy the full SHA 9ee68faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 12d54c9 - Browse repository at this point
Copy the full SHA 12d54c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for b929676 - Browse repository at this point
Copy the full SHA b929676View commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e473f72 - Browse repository at this point
Copy the full SHA e473f72View commit details -
Update packages/builtin_test/_test.pony
Co-authored-by: Sean T Allen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bed272f - Browse repository at this point
Copy the full SHA bed272fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7daa238 - Browse repository at this point
Copy the full SHA 7daa238View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19bc608 - Browse repository at this point
Copy the full SHA 19bc608View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30e47db - Browse repository at this point
Copy the full SHA 30e47dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for e2fa066 - Browse repository at this point
Copy the full SHA e2fa066View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d9099d - Browse repository at this point
Copy the full SHA 0d9099dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e83ea4c - Browse repository at this point
Copy the full SHA e83ea4cView commit details -
Ouch -- USize overflow when `_size - src_index` < 0!
Configuration menu - View commit details
-
Copy full SHA for 1e2448c - Browse repository at this point
Copy the full SHA 1e2448cView commit details
Commits on Aug 9, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6c9b5ee - Browse repository at this point
Copy the full SHA 6c9b5eeView commit details
Commits on Aug 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5f763f6 - Browse repository at this point
Copy the full SHA 5f763f6View commit details
Commits on Aug 17, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4ff03ba - Browse repository at this point
Copy the full SHA 4ff03baView commit details -
Configuration menu - View commit details
-
Copy full SHA for c3ca05b - Browse repository at this point
Copy the full SHA c3ca05bView commit details
Commits on Aug 22, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f70d7b9 - Browse repository at this point
Copy the full SHA f70d7b9View commit details -
It is actually Ok if the `dst_idx == dst._size` (no gap)
Configuration menu - View commit details
-
Copy full SHA for 3c99979 - Browse repository at this point
Copy the full SHA 3c99979View commit details
Commits on Aug 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 111189d - Browse repository at this point
Copy the full SHA 111189dView commit details
Commits on Sep 18, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5b1542d - Browse repository at this point
Copy the full SHA 5b1542dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f4f271 - Browse repository at this point
Copy the full SHA 9f4f271View commit details
Commits on Sep 19, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bb41b02 - Browse repository at this point
Copy the full SHA bb41b02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 24cf1ef - Browse repository at this point
Copy the full SHA 24cf1efView commit details
Commits on Sep 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 759b525 - Browse repository at this point
Copy the full SHA 759b525View commit details