-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Remove inappropriate array index error on slice copy (stable) #13265
Conversation
|
Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + dmd#13265" |
|
I'm doing this because https://issues.dlang.org/show_bug.cgi?id=15889 was re-opened |
6fe7408 to
792987b
Compare
|
If the bootstrap failure is not related, just force merge this. |
* Remove inappropriate array index error on slice copy (#13265) * d_do_test: Add --DRT-testmode=run-main even without `EXECUTE_ARGS` (#13282) The runtime flags is necessary based on the compiler flags and hence can be required when there are no runtime arguments. * Fix 18054 - Use isBool instead of toInteger when const-folding cast(bool) (#13285) `RealExp` / `ComplexExp` may hold values that don't have a matching integer value (unlike `IntegerExp`). Switching to `toBool` ensures proper boolean conversion according to the current type. The test output shown below (before this change) was caused by the invalid const-folding for floating point literals. ``` float: 1 == 0 double: 1 == 0 real: 1 == 0 ifloat: 1 == 0 idouble: 1 == 0 ireal: 1 == 0 cfloat: 1 == 0 cdouble: 1 == 0 creal: 1 == 0 ``` * fix Issue 22398 - importC: Error: unknown, when compiling source with non-constant initializer * Fix Issue 21073 - Rebindable does not work when class has alias this to inout property (#13291) The cast expression was trying an 'alias this' but without error gagging. * Fix Issue 16579 - ReturnStatement[CallExp(DotVarExp)]: Corrupted runtime on missed manifest constant propagation A void returning statement 'return exp;' is rewritten to 'exp; return;' but in that case an optimize() call was missing, which was just a little above. * fix Issue 22432 - ImportC: casting result of postfix operator on a parenthesized expression to a typedef.d type is parsed incorrectly * fix Issue 22422 - ImportC: parse gnu attributes after a function parameter (#13300) * Fix 22516 - Set TypeError as return type if inference was skipped... (#13313) ... due to previous errors in the parent. This ensures that further code doesn't have to check for unset return type while still keeping the other information (paramter types, ...) available. * ImportC: make static functions local * Fix 22514 - Don't raise invalid duplicate case errors when the switch... ... has other errors. The duplicate case checks triggered because #11467 made `ErrorExp` into a singleton and hence caused `ErrorExp` == `ErrorExp` to yield true even if those errors were caused by different expressions. This situation can arise from two different user errors: 1. the case is faulty, e.g. an unknown variable 2. the switch'ed value is faulty, causing `implicitCastTo` to generate an `ErrorExp`. This commit fixes (1) by simply skipping the ducplicated case check for `ErrorExp` because it doesn't have enough information. (2) requires the case expression to not be coerced into the switched type s.t. we can at least detect some errors while also keeping the actual case expression to offer helpful diagnostics. * fix Issue 22517 - [REG 2.093][ICE] Bus error at dmd/lexer.d:398 * fix Issue 22428 - importC: static variables/functions emit global symbols * Fix Issue 22530 - Explicit cast between classes incorrectly goes through 'alias this' inside CTFE (#13332) * fix Issue 22513 - ImportC: address of member of struct cannot be taken at compile time * fix Issue 22500 - ImportC: Lots of errors when compiling tomlc99 * fix Issue 22512 - importC: incomplete array type must have initializer (#13345) * fix Issue 22512 - importC: incomplete array type must have initializer * fix Issue 22512 - importC: incomplete array type must have initializer Co-authored-by: Walter Bright <walter@walterbright.com> * [stable] importC: Backport master fixes to stable (#13344) * fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended * ImportC: improve parsing error message Co-authored-by: Walter Bright <walter@walterbright.com> * Fix Issue 22529 - wrong deprecation about empty statement (#13347) * Fix Issue 21414 - Spurious non-constant expression error with immutable constructors (#13358) * Fix Issue 22385 - CTFE fails to iterate over associative array previously indexed with implicit conversion to enum base type (#13326) * Fix issue 22549 - float literal should support leading zero * Fix Issue 20860 - OpDispatch does not work for structs with constructor and destructor * fix Issue 22560 - ImportC: extra semicolon not allowed outside of functions * fix Issue 22534 - ImportC: const pointer (not pointer to const) is treated as transitive const (#13378) * Fix build for Solaris/Illumos Fix Issue 22573 - DMD compiler errors on Illumos/Solaris * Fix Issue 22570 - more arguments than fields allowed in struct constructor * fix Issue 22538, fix Issue 22537 - ImportC: multiple static / non-static declarations of same function * Issue 22574 - Compiler segfaults on `template test(x* x)` (#13393) * Fix Issue 22574 - Compiler segfaults on `template test(x* x)` * Incorporate razvan review * Fix build for Solaris/Illumos Fix Issue 22573 - DMD compiler errors on Illumos/Solaris Co-authored-by: Brian Callahan <bcallah@openbsd.org> * fix Issue 22584 - importC: Error: undefined reference to 'parameter' when no parameter names in forward declaration * Fix Issue 20236 - spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target (#13397) * fix Issue 22577 - ImportC: decay of function to typedef'd const function pointer causes ICE (#13412) * bump VERSION to v2.098.1-beta.1 Co-authored-by: Dennis <dkorpel@users.noreply.github.com> Co-authored-by: Florian <moonlightsentinel@disroot.org> Co-authored-by: Walter Bright <walter@walterbright.com> Co-authored-by: Boris Carvajal <boris2.9@gmail.com> Co-authored-by: Walter Bright <WalterBright@users.noreply.github.com> Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org> Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com> Co-authored-by: lucica28 <57060141+lucica28@users.noreply.github.com> Co-authored-by: dkorpel <dkorpel@gmail.com> Co-authored-by: Brian Callahan <bcallah@openbsd.org> Co-authored-by: Max Haughton <maxhaton@gmail.com>
* Remove inappropriate array index error on slice copy (#13265) * d_do_test: Add --DRT-testmode=run-main even without `EXECUTE_ARGS` (#13282) The runtime flags is necessary based on the compiler flags and hence can be required when there are no runtime arguments. * Fix 18054 - Use isBool instead of toInteger when const-folding cast(bool) (#13285) `RealExp` / `ComplexExp` may hold values that don't have a matching integer value (unlike `IntegerExp`). Switching to `toBool` ensures proper boolean conversion according to the current type. The test output shown below (before this change) was caused by the invalid const-folding for floating point literals. ``` float: 1 == 0 double: 1 == 0 real: 1 == 0 ifloat: 1 == 0 idouble: 1 == 0 ireal: 1 == 0 cfloat: 1 == 0 cdouble: 1 == 0 creal: 1 == 0 ``` * fix Issue 22398 - importC: Error: unknown, when compiling source with non-constant initializer * Fix Issue 21073 - Rebindable does not work when class has alias this to inout property (#13291) The cast expression was trying an 'alias this' but without error gagging. * Fix Issue 16579 - ReturnStatement[CallExp(DotVarExp)]: Corrupted runtime on missed manifest constant propagation A void returning statement 'return exp;' is rewritten to 'exp; return;' but in that case an optimize() call was missing, which was just a little above. * fix Issue 22432 - ImportC: casting result of postfix operator on a parenthesized expression to a typedef.d type is parsed incorrectly * fix Issue 22422 - ImportC: parse gnu attributes after a function parameter (#13300) * Fix 22516 - Set TypeError as return type if inference was skipped... (#13313) ... due to previous errors in the parent. This ensures that further code doesn't have to check for unset return type while still keeping the other information (paramter types, ...) available. * ImportC: make static functions local * Fix 22514 - Don't raise invalid duplicate case errors when the switch... ... has other errors. The duplicate case checks triggered because #11467 made `ErrorExp` into a singleton and hence caused `ErrorExp` == `ErrorExp` to yield true even if those errors were caused by different expressions. This situation can arise from two different user errors: 1. the case is faulty, e.g. an unknown variable 2. the switch'ed value is faulty, causing `implicitCastTo` to generate an `ErrorExp`. This commit fixes (1) by simply skipping the ducplicated case check for `ErrorExp` because it doesn't have enough information. (2) requires the case expression to not be coerced into the switched type s.t. we can at least detect some errors while also keeping the actual case expression to offer helpful diagnostics. * fix Issue 22517 - [REG 2.093][ICE] Bus error at dmd/lexer.d:398 * fix Issue 22428 - importC: static variables/functions emit global symbols * Fix Issue 22530 - Explicit cast between classes incorrectly goes through 'alias this' inside CTFE (#13332) * fix Issue 22513 - ImportC: address of member of struct cannot be taken at compile time * fix Issue 22500 - ImportC: Lots of errors when compiling tomlc99 * fix Issue 22512 - importC: incomplete array type must have initializer (#13345) * fix Issue 22512 - importC: incomplete array type must have initializer * fix Issue 22512 - importC: incomplete array type must have initializer Co-authored-by: Walter Bright <walter@walterbright.com> * [stable] importC: Backport master fixes to stable (#13344) * fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended * ImportC: improve parsing error message Co-authored-by: Walter Bright <walter@walterbright.com> * Fix Issue 22529 - wrong deprecation about empty statement (#13347) * Fix Issue 21414 - Spurious non-constant expression error with immutable constructors (#13358) * Fix Issue 22385 - CTFE fails to iterate over associative array previously indexed with implicit conversion to enum base type (#13326) * Fix issue 22549 - float literal should support leading zero * Fix Issue 20860 - OpDispatch does not work for structs with constructor and destructor * fix Issue 22560 - ImportC: extra semicolon not allowed outside of functions * fix Issue 22534 - ImportC: const pointer (not pointer to const) is treated as transitive const (#13378) * Fix build for Solaris/Illumos Fix Issue 22573 - DMD compiler errors on Illumos/Solaris * Fix Issue 22570 - more arguments than fields allowed in struct constructor * fix Issue 22538, fix Issue 22537 - ImportC: multiple static / non-static declarations of same function * Issue 22574 - Compiler segfaults on `template test(x* x)` (#13393) * Fix Issue 22574 - Compiler segfaults on `template test(x* x)` * Incorporate razvan review * Fix build for Solaris/Illumos Fix Issue 22573 - DMD compiler errors on Illumos/Solaris Co-authored-by: Brian Callahan <bcallah@openbsd.org> * fix Issue 22584 - importC: Error: undefined reference to 'parameter' when no parameter names in forward declaration * Fix Issue 20236 - spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target (#13397) * fix Issue 22577 - ImportC: decay of function to typedef'd const function pointer causes ICE (#13412) * bump VERSION to v2.098.1-beta.1 * fix Issue 22592 - importC: Segmentation fault indexing global array at run-time * fix Issue 22589 - importC: Error: undefined reference to '__builtin_va_start' and '__builtin_va_end' * fix Issue 22585 - importC: Error: variable 'var' extern symbols cannot have initializers * fix Issue 22597 - importC: Segmentation fault initializing va_list with __builtin_va_start (#13425) * Fix Issue 22593 - ICE on overloaded constructors * fix Issue 22558 - [REG 2.098] Error: function 'core.stdc.stdio.vfprintf' 'pragma(printf)' functions must be 'extern(C) int vfprintf([parameters...], const(char)*, va_list)' * fix Issue 22591 - importC: Debug information for C sources have DW_AT_language set to D (#13430) * minor refactor of elfobj.d and glue.d * fix Issue 22602 - importC: Error: cannot convert string literal to 'void*' * fix Issue 22531 - importC: D name mangling applied to forward declaration of function inside function (#13441) * fix Issue 22576 - ImportC: cannot implicitly convert expression S(0) of type S to int in an S array (#13437) * bump VERSION to v2.098.1 * fix Issue 22597 - importC: Segmentation fault initializing va_list with __builtin_va_start (fixup) Co-authored-by: Dennis <dkorpel@users.noreply.github.com> Co-authored-by: Florian <moonlightsentinel@disroot.org> Co-authored-by: Walter Bright <walter@walterbright.com> Co-authored-by: Boris Carvajal <boris2.9@gmail.com> Co-authored-by: Walter Bright <WalterBright@users.noreply.github.com> Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com> Co-authored-by: lucica28 <57060141+lucica28@users.noreply.github.com> Co-authored-by: dkorpel <dkorpel@gmail.com> Co-authored-by: Brian Callahan <bcallah@openbsd.org> Co-authored-by: Max Haughton <maxhaton@gmail.com> Co-authored-by: Martin Nowak <code@dawg.eu>
Same as #13010 but targetting stable this time