Skip to content
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

Runtime safety (panic interface, slices) #19764

Open
wants to merge 154 commits into
base: master
Choose a base branch
from

Commits on Mar 10, 2024

  1. Configuration menu
    Copy the full SHA
    94cc651 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a2df9d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f9e0050 View commit details
    Browse the repository at this point in the history
  4. std.builtin: Added the standard library implementation for panicNew.

                 Helper functions require standard library substitutes.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    886fd57 View commit details
    Browse the repository at this point in the history
  5. std.multi_array_list: Rewrote MultiArrayList.Slice.items to not

                          require the extreme slice edge-case: slice of
                          comptime-known pointer with runtime-known end.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    51b75df View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ff948d0 View commit details
    Browse the repository at this point in the history
  7. type: Added function allowSentinel for determining whether an aggre…

    …gate of
    
          type `ty` permits sentinels.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    15c882c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f488c1f View commit details
    Browse the repository at this point in the history
  9. Compilation: Added runtime_safety to cache. Currently using the

                 'convenience' declaration of `runtime_safety`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    9024015 View commit details
    Browse the repository at this point in the history
  10. Package.Module:

    * Added convenience declaration `runtime_safety`.
    * This value modified directly from the command line in `main.zig`.
    * This value is used to initialize `Builtin` options field `runtime_safety`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    e1050b8 View commit details
    Browse the repository at this point in the history
  11. main:

    * Updated command line parser to parse controls for each panic cause compile command:
         `-funwrapped-error`,
         `-funwrapped-null`,
         `-freturned-noreturn`,
         `-freached-unreachable`,
         `-faccessed-out-of-bounds`,
         `-faccessed-out-of-order`,
         `-faccessed-inactive-field`,
         `-fdivided-by-zero`,
         `-fmemcpy-argument-aliasing`,
         `-fmismatched-memcpy-argument-lengths`,
         `-fmismatched-for-loop-capture-lengths`,
         `-fmismatched-sentinel`,
         `-fshift-amt-overflowed`,
         `-farith-overflowed`,
         `-fcast-truncated-data`,
         `-fcast-to-enum-from-invalid`,
         `-fcast-to-error-from-invalid`,
         `-fcast-to-pointer-from-invalid`,
         `-fcast-to-int-from-invalid`,
         `-fcast-to-unsigned-from-negative`.
    * Updated command line parser to parse convenience/test flags:
        `-fruntime-safety`,
        `-f[no-]analyze-slice2`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    65ce79e View commit details
    Browse the repository at this point in the history
  12. Sema: Each of the following additions are to a sub-namespace `Runtime…

    …Safety`.
    
          When testing is complete this namespace will be removed and all
          analogous functions in the file scope will be replaced.
    
    * Added helper functions:
        `preparePanicCause`,
        `failBlock`,
        `preparePanicExtraType`,
        `callBuiltinHelper`,
        `wantPanicCause`,
        `bestGenericIntType`,
        `resolveArithOverflowedPanicImpl`,
        `resolveArithOverflowedPanicCause`,
        `abiSizeOfContainingDecl`.
    
    * Added panic preparation functions:
        `panicWithMsg`,
        `panicReachedUnreachable`,
        `panicCastToEnumFromInvalid`,
        `panicUnwrappedError`,
        `checkAccessNullValue`,
        `checkUnwrappedError`,
        `checkDivisionByZero`,
        `checkAccessOutOfBounds`,
        `checkAccessOutOfOrder`,
        `checkAccessOutOfOrderExtra`,
        `checkAliasingMemcpyArguments`,
        `checkMismatchedMemcpyArgumentLengths`,
        `checkMismatchedForLoopCaptureLengths`,
        `checkAccessInactiveUnionField`,
        `checkMismatchedSentinel`,
        `checkMismatchedNullTerminator`,
        `checkShiftAmountOverflow`,
        `checkArithmeticOverflow`,
        `checkCastToEnumFromInvalid`,
        `checkCastToEnumFromInvalidHelper`,
        `checkCastToErrorFromInvalid`,
        `checkCastToErrorFromInvalidHelper`,
        `checkCastToPointerFromInvalid`,
        `checkCastToIntFromInvalid`,
        `checkCastTruncatedData`,
        `checkCastToUnsignedFromNegative`.
    
    * Added primary functions:
        `zirSliceStart`,
        `zirSliceEnd`,
        `zirSliceSentinel`,
        `zirSliceLength`,
        `analyzeSlice2`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    6e29a90 View commit details
    Browse the repository at this point in the history
  13. Sema: Added compile errors for non-scalar sentinels in functions:

          `zirReify`, `zirArrayTypeSentinel`,
          `zirPtrType`, `analyzeSlice`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    a65c226 View commit details
    Browse the repository at this point in the history
  14. Sema: Added optional usage of analyzeSlice2 by functions:

          `zirSliceStart`, `zirSliceEnd`,
          `zirSliceSentinel`, and `zirSliceLength`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    b0e6394 View commit details
    Browse the repository at this point in the history
  15. Sema: Added optional usage of panicReachedUnreachable by

          `Block.addUnreachable`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    d178d20 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    11691df View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    04d7b0e View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    436caf6 View commit details
    Browse the repository at this point in the history
  19. Sema: Added optional usage of checkCastToErrorFromInvalid

          by `zirErrorFromInt`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    64c2137 View commit details
    Browse the repository at this point in the history
  20. Sema: Added optional usage of checkCastToEnumFromInvalid by

          `zirEnumFromInt`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    c51b932 View commit details
    Browse the repository at this point in the history
  21. Sema: Added optional usage of checkAccessNullValue by

          `analyzeOptionalPayloadPtr`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    0844b72 View commit details
    Browse the repository at this point in the history
  22. Sema: Added optional usage of checkAccessNullValue by

          `zirOptionalPayload`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    901b465 View commit details
    Browse the repository at this point in the history
  23. Sema: Added optional usage of checkUnwrappedError by

          `analyzeErrUnionPayload`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    00d73f8 View commit details
    Browse the repository at this point in the history
  24. Sema: Added optional usage of checkUnwrappedError by

          `analyzeErrUnionPayloadPtr`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    7b733e7 View commit details
    Browse the repository at this point in the history
  25. Sema: Added optional usage of checkCastTruncatedData and

          `checkCastToUnsignedFromNegative` by `intCast`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    bc638a2 View commit details
    Browse the repository at this point in the history
  26. Sema: Added optional usage of checkCastToEnumFromInvalid by

          `zirSwitchBlock`. This is potentially the wrong panic cause, but
          aligns more closely with the backend requirement.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    4563dc6 View commit details
    Browse the repository at this point in the history
  27. Sema: Added optional usage of checkCastToEnumFromInvalid and

          `panicReachedUnreachable` by `analyzeSwitchRuntimeBlock`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    c6d9548 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    1bf37e6 View commit details
    Browse the repository at this point in the history
  29. Sema: Added usage of checkShiftAmountOverflow and

          `checkArithmeticOverflow` by `zirShl`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    9242dac View commit details
    Browse the repository at this point in the history
  30. Sema: Added optional usage of checkShiftAmountOverflow and

          `checkArithmeticOverflow` by `zirShr`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    b9041bf View commit details
    Browse the repository at this point in the history
  31. Sema: Added optional usage of checkArithmeticOverflow by

          `zirDivExact`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    442a35f View commit details
    Browse the repository at this point in the history
  32. Sema: Added optional usage of checkArithmeticOverflow by

          `addDivIntOverflowSafety`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    8febf86 View commit details
    Browse the repository at this point in the history
  33. Sema: Added optional usage of checkDivisionByZero by

          `addDivByZeroSafety`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    39ddcd2 View commit details
    Browse the repository at this point in the history
  34. Sema: Added optional usage of checkArithmeticOverflow by

          `analyzeArithmetic`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    3f2a60f View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    2cd6aa5 View commit details
    Browse the repository at this point in the history
  36. Sema: Added optional usage of checkCastToIntFromInvalid by

          `zirIntFromFloat`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    67da75a View commit details
    Browse the repository at this point in the history
  37. Sema: Added optional usage of checkCastToPointerFromInvalid by

          `zirPtrFromInt`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    2ba80f4 View commit details
    Browse the repository at this point in the history
  38. Sema: Added optional usage of checkCastToErrorFromInvalid by

          `zirErrorCast`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    218209e View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    1fc3ed0 View commit details
    Browse the repository at this point in the history
  40. Sema: Added optional usage of checkAliasingMemcpyArguments,

          `checkMismatchedMemcpyArgumentLengths`, and `analyzeSlice2` by
          `zirMemcpy`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    b77bc3f View commit details
    Browse the repository at this point in the history
  41. Sema: Added optional usage of checkAccessInactiveUnionField by

          `unionFieldPtr`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    da5d75b View commit details
    Browse the repository at this point in the history
  42. Sema: Added optional usage of checkAccessInactiveUnionField by

          `unionFieldVal`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    fdeb462 View commit details
    Browse the repository at this point in the history
  43. Sema: Added optional usage of checkAccessOutOfBounds by

          `elemValArray`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    a706bf6 View commit details
    Browse the repository at this point in the history
  44. Sema: Added optional usage of checkAccessOutOfBounds by

          `elemPtrArray`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    8d52709 View commit details
    Browse the repository at this point in the history
  45. Sema: Added optional usage of checkAccessOutOfBounds by

          `elemValSlice`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    5748840 View commit details
    Browse the repository at this point in the history
  46. Sema: Added optional usage of checkAccessOutOfBounds by

          `elemPtrSlice`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    a6b7cb7 View commit details
    Browse the repository at this point in the history
  47. Sema: Added optional usage of checkCastToPointerFromInvalid by

          `coerceCompatiblePtrs`.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    99dd22a View commit details
    Browse the repository at this point in the history
  48. Sema:

    * Added optional usage of `checkAccessNullValue`,
      `checkAccessOutOfBounds`, `checkAccessOutOfOrder`, and
      `checkMismatchedSentinel` by `analyzeSlice`.
    * Updated fail block initializer.
    amp-59 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    05730b4 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. Configuration menu
    Copy the full SHA
    e67ac50 View commit details
    Browse the repository at this point in the history
  2. std.debug:

    * Effectively renamed `panicImpl` to `panicImplDefault`, and replaced
      `panicImpl` definition of former `builtin.default_panic`.
    * Replaced usage of `builtin.panic` by `panicExtra` with call to
      `panicImpl`.
    amp-59 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    fe3bd05 View commit details
    Browse the repository at this point in the history
  3. std.builtin:

    * Removed sanity check (for unreachable causes).
    * Other minor fixes and improvements.
    amp-59 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    d9a4cf1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a5e4c95 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Configuration menu
    Copy the full SHA
    f029550 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    53586d2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8c04e3a View commit details
    Browse the repository at this point in the history
  4. Sema: Attempted to reduce the number and frequency of use of potentially

          confusing `uncasted_*_opt` references by `analyzeSlice2`.
    amp-59 committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    1166e34 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2ab3c36 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2024

  1. Configuration menu
    Copy the full SHA
    f190dc1 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Configuration menu
    Copy the full SHA
    3293103 View commit details
    Browse the repository at this point in the history
  2. builtin: Removed packed from panic data type for

             `accessed_inactive_field`.
    amp-59 committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    e704d9a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d995178 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2024

  1. builtin: Changed error message to be adequate for a larger number of

             error cases. An ideal solution would distinguish between index
             out-of-bounds and slice operand out-of-bounds.
    amp-59 committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    0152d9d View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2024

  1. Configuration menu
    Copy the full SHA
    48697fc View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    5ba88af View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2024

  1. Configuration menu
    Copy the full SHA
    17346b8 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. Configuration menu
    Copy the full SHA
    3734c11 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2024

  1. Sema:

    * Added functions to enable slicing reinterpreted compile-time
      memory when the element type has no runtime bits.
    * Reworded documentation comment for `abiSizeOfContainingDecl`.
    amp-59 committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    00d7c23 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8178ed6 View commit details
    Browse the repository at this point in the history
  3. Sema:

    * Updated `RuntimeSafety.analyzeSlice2` to support slicing
      pointers-to-many for element types with zero runtime bits.
    * Simplified compile error message for `slice_start` when sentinel index
      is out of bounds.
    amp-59 committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    d107743 View commit details
    Browse the repository at this point in the history
  4. test: Updated return types.

    amp-59 committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    4426504 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5dd4f39 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1fb30d9 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2024

  1. Sema: Corrected toUnsignedInt to getUnsignedIntAdvanced. This unwrap

          can be null if `usize` is larger than `u64`.
    amp-59 committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    411dba1 View commit details
    Browse the repository at this point in the history
  2. builtin:

    * Generally updated panic message writers to move closer to a final version.
    * Added sums of bytes written to panic message buffers for some code blocks.
    * Added comment reminding to treat indexing bounds and slicing bounds separately
      for clarity and consistency of error messages.
    * Updated panic message writers writing arbitrarily long strings to use
      `cpyEquTrunc`. This limits the number of bytes taken by any single
      component of the error message. The primary motivation for this is to
      prevent very large type names from consuming the entire buffer before
      any other panic data can be rendered.
    
      Truncated strings are indicated like 'looooooong_stri[..]', so the
      minimum budget for any copy is 4.
    
      Example for `panicAccessedInactiveField` with a purposefully low tag name
      budget of 16:
    
      "access of union field 'b_long_inact[..]' while field 'b_long_activ[..]' is active"
    amp-59 committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    c7d4e58 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e3cdf74 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bac3b9f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d989c59 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. Configuration menu
    Copy the full SHA
    ce79ca8 View commit details
    Browse the repository at this point in the history
  2. builtin:

    * Added standard documentation about compiler dependency to
      `RuntimeSafety` as well as note on how it might be used in the
      future.
    * Renamed `panicNew_default` to `panicImpl`.
    * Relocated (removed) writer functions.
    * Relocated or deleted helper functions.
    
    debug:
    * Relocated (added) writer functions.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    ee49dc2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d214cfc View commit details
    Browse the repository at this point in the history
  4. test:

    * Added behavior test for slice success variants.
    * Removed redundant slice runtime safety test. This and other tests will
      be restored when feedback is given on the allowed number of slice runtime
      safety tests.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    8059085 View commit details
    Browse the repository at this point in the history
  5. test: Restored many runtime safety tests. This includes some slice

          tests which will be redundant if the `Sema.analyzeSlice2`
          runtime safety tests are added. However if that addition is not
          approved these tests will provide basic coverage until a more concise
          testsuite can be generated.
    
          Between 60 and 70 of these 82 files will pass for the x86-64
          backend. This difference is caused by missing features, such
          as vector operations and checking enumeration values and error codes.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    fe2e299 View commit details
    Browse the repository at this point in the history
  6. test: Included slice2.zig in behavior.zig. A recent release

          version (0.13.0-dev.46+3648d7df1) of the compiler will crash when
          attempting `zig test test/behavior/slice2.zig`.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    1519f84 View commit details
    Browse the repository at this point in the history
  7. test: Updated test "type pun signed and unsigned as array pointer",

          so that it does not require the creation of an invalid slice.
          This change does not impact the test result.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    72c854e View commit details
    Browse the repository at this point in the history
  8. test: Updated test "comptime slice-sentinel in bounds (on target sent…

    …inel)"
    
          so that the type of local slice `target` includes the necessary sentinel.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    cb99c8e View commit details
    Browse the repository at this point in the history
  9. test: Removed test using illegal combination of slice inputs. That is,

          `slice_end` slicing compile-time-known undefined pointer using
          runtime-known end operand.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    45fa681 View commit details
    Browse the repository at this point in the history
  10. test:

    * Updated test `foo_cvector_ConstPtrSpecialRef` to include required
      sentinel in type definition.
    * Updated various compile errors.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    f24a0fa View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    812ff6c View commit details
    Browse the repository at this point in the history
  12. test: Added compile error variants of Sema.analyzeSlice2 testsuite.

          This selection could be improved by adding variants for 0-bit and
          `comptime`-only types.
    amp-59 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    8de4351 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    5f3555a View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. test:

    * Updated definitions of `panicNew` to account for the loss of
      `runtime_safety` builtin information. `builtin.PanicData` can no
      longer predict `void` values. This may be restored in future updates.
    * Changed some cases from `reached_unreachable` to `unwrapped_error`.
    * Changed some cases from `corrupt_switch` to `cast_to_enum_from_invalid`.
    amp-59 committed May 10, 2024
    Configuration menu
    Copy the full SHA
    fdfb156 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d0d66f9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c459905 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e9cc266 View commit details
    Browse the repository at this point in the history
  5. Sema: Removed air_tag_safe from primary analyzeArithmetic switch, as

          this is no longer usable.
    amp-59 committed May 10, 2024
    Configuration menu
    Copy the full SHA
    5f92f62 View commit details
    Browse the repository at this point in the history
  6. Sema: Added check for backend support for error return trace. It is

          possible that the current implementation only calls this function
          after having already established backend support, however it might
          not be the case that backend support for `error_return_trace` and
          `unwrap_error` are the same. In this case case a lot of the `unwrap_error`
          panic data may be reported without the `builtin.StackTrace` pointer.
    amp-59 committed May 10, 2024
    Configuration menu
    Copy the full SHA
    e43d6be View commit details
    Browse the repository at this point in the history
  7. Sema: Removed analyzeSlice.

    amp-59 committed May 10, 2024
    Configuration menu
    Copy the full SHA
    0eaa15c View commit details
    Browse the repository at this point in the history

Commits on May 11, 2024

  1. Sema:

    * Improved general usability of panic preparation functions by
      preventing usage by backends which do not support the feature.
    
      Note: The x86-64 backend actually does support all but three of the
      current panic causes. It does not support `checkCastToEnumFromInvalid`
      and `checkCastToErrorFromInvalid`, nor does it support the former
      `corrupt_switch` panic cause (except in one unconditional case)--but
      this might be unreachable for other reasons.
    
    * Updated `reinterpretLength` to allow recursively reinterpreting
      arrays of arrays, arrays of vectors, and vectors of arrays of the
      child type.
    
    * Relocated helper functions `reinterpretLength`,
      `reinterpretLengthOfContainingDecl`, and `abiSizeOfContainingDecl`, which may
      be suitable for general use.
    
    * Removed extra definition of `Sema.analyzeSlice2` from the sub-namespace.
    
    * Added experimental `addSubSafeOptimized`. This function has been
      tested to produce a small optimisation to arithmetic overflow checks,
      which are currently very expensive when generated by LLVM. The
      soundness of this function has not been totally verified, so it
      remains unused.
    amp-59 committed May 11, 2024
    Configuration menu
    Copy the full SHA
    95122fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9f147ed View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    83d9fa6 View commit details
    Browse the repository at this point in the history
  4. Sema: Added attempt to optimise arithmetic overflow check. This has

          a small effect overall, because the applicable variants are not
          very common (in empty main). However the effect will likely be
          much larger for functions in `std.crypto`, where the variant is
          frequently seen in inline while loops.
    amp-59 committed May 11, 2024
    Configuration menu
    Copy the full SHA
    094d970 View commit details
    Browse the repository at this point in the history
  5. Sema: Updated prepareRuntimeSafety to be less lenient regarding `pa…

    …nic`
    
          parameter count.
    amp-59 committed May 11, 2024
    Configuration menu
    Copy the full SHA
    4c1a227 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2024

  1. Configuration menu
    Copy the full SHA
    3486a21 View commit details
    Browse the repository at this point in the history
  2. builtin:

    * Removed explicit field values from `PanicCause`. These will not
      be required until the `RuntimeSafety` type is used to manage
      the state of runtime safety features.
    * Swapped field order of `ErrorStackTrace`.
    amp-59 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    ea8f407 View commit details
    Browse the repository at this point in the history
  3. builtin: Updated PanicData to match the compiler implementation

             precisely. Note that mismatches have not been ruled out, but
             none are known.
    amp-59 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    1c19a5c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3e82d47 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    942806f View commit details
    Browse the repository at this point in the history
  6. debug: Minor restructure to provide for rendering operands in

           'checked vector arithmetic'.
    amp-59 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    f72f49b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a90c4f9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c23e812 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    eb367f4 View commit details
    Browse the repository at this point in the history
  10. Module:

    * Removed unused cache elements.
    * Removed more references to `runtime_safety`.
    amp-59 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    f13051d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6e2e9f0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d7ea11c View commit details
    Browse the repository at this point in the history

Commits on May 14, 2024

  1. Configuration menu
    Copy the full SHA
    1072c2a View commit details
    Browse the repository at this point in the history
  2. Sema: Removed unused functions: panicWithMsg, panicUnwrapError,

          `panicIndexOutOfBounds`, `panicInactiveUnionField`,
          `panicSentinelMismatch`, `safetyCheckFormatted`, and `safetyPanic`.
    amp-59 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    2d3846d View commit details
    Browse the repository at this point in the history
  3. test:

    * Removed `export` from functions declared in slice success cases
      behaviour test.
    * Added skip for `stage2_riscv64` backend for the same slice behaviour test.
    amp-59 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    9c6b1f4 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Configuration menu
    Copy the full SHA
    c8296a5 View commit details
    Browse the repository at this point in the history
  2. builtin: Removed panic causes without panic data from primary switch, as

             these are unreachable due to the preceding if-expression.
    amp-59 committed May 16, 2024
    Configuration menu
    Copy the full SHA
    d7aa820 View commit details
    Browse the repository at this point in the history
  3. debug: Combined error message writers for `(add|sub|div|mul)_overflow…

    …ed`.
    
           This is more efficient for the standard library, because all of these
           are likely to be compiled before reaching `main`.
    amp-59 committed May 16, 2024
    Configuration menu
    Copy the full SHA
    e817541 View commit details
    Browse the repository at this point in the history
  4. Sema: Removed experimental optimisation. It caused problems with

          `riscv64` + `-fno-llvm`, `-fno-lld`.
    amp-59 committed May 16, 2024
    Configuration menu
    Copy the full SHA
    7e617d2 View commit details
    Browse the repository at this point in the history
  5. Sema:

    * Removed `addSafetyCheck`.
    * `addSafetyCheck` will not insert a trap if the target fail block has
      no instructions.
    amp-59 committed May 16, 2024
    Configuration menu
    Copy the full SHA
    e5dffaa View commit details
    Browse the repository at this point in the history
  6. Sema:

    * Removed `haveRuntimeSafetyPanic`.
    * Added traps where required.
    
    target: Temporarily disabled `riscv64` panics. This was recently added
            for the old interface but I know nothing about the requirements for the
            new interface.
    amp-59 committed May 16, 2024
    Configuration menu
    Copy the full SHA
    0fa47ce View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    29f35cc View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. nextafter: Added workaround to avoid introduction of zig_make_big,

               etc. for tests using `-ofmt=c`.
    amp-59 committed May 17, 2024
    Configuration menu
    Copy the full SHA
    7fed217 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. Configuration menu
    Copy the full SHA
    d4e9d57 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b300fb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2945639 View commit details
    Browse the repository at this point in the history
  4. test: Added runtime panic variants for slices of various pointers to

          unsigned 8-bit integers.
    amp-59 committed May 20, 2024
    Configuration menu
    Copy the full SHA
    d1a246c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ecc1860 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. Configuration menu
    Copy the full SHA
    c51a44e View commit details
    Browse the repository at this point in the history
  2. c: Updated definitions related to panic2.

    compiler_rt: Updated definitions related to `panic2`.
    builtin: Removed panic causes `inc_overflowed` and `dec_overflowed`.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    2c4bca6 View commit details
    Browse the repository at this point in the history
  3. builtin:

    * Removed notes on backend logic and renaming.
    * `panic` should probably not be removed for some time, as doing so will
      break every compiler not built using this branch.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    7df0078 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d796bc5 View commit details
    Browse the repository at this point in the history
  5. Sema:

    * Updated `failWithOwnedErrorMsg` to call `compilerPanicSimple`.
    * Simplified compile error messages for slice start out-of-bounds.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    80b95f7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b2aec81 View commit details
    Browse the repository at this point in the history
  7. Sema: Restored usage of safe arithmetic instructions when the panic

          interface is simple.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    8b3bd60 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c378d7f View commit details
    Browse the repository at this point in the history
  9. Sema: Many minor changes intended to enable reuse of generic

          instantiations, by means of a simple constant-time cache.
    
          This saves approximately 3000 calls to `instantiateGenericCall`
          for empty main, and allows usage of 'simple panic' by the LLVM
          codegen.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    7c28d24 View commit details
    Browse the repository at this point in the history
  10. llvm:

    * Rewrote `buildSimplePanic` to use new interface.
    * Updated `airSafeArithmetic` to call `buildSimplePanic`.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    cbbb9d3 View commit details
    Browse the repository at this point in the history
  11. Sema:

    * Removed unused function `prepareSimplePanic`.
    * Removed unused `compilerPanic`.
    * Renamed `compilerPanicNew` to `compilerPanic`.
    * Added `compilerPanicSimple` to use the simple interface.
    * Made `compilerPanicSimple` the default interface for the compiler.
    
      I have no opinion on whether this last change should remain, it simply
      improves compiler rebuild times by 30 seconds for `Debug`.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    2f06f82 View commit details
    Browse the repository at this point in the history
  12. test:

    * Updated definition of `panic2` by `panic_has_source_location`.
    * Increased number of slice compile errors by ~30%. Decreased source code
      size by ~30%.
    * Updated definition of `panic2` by godbold test code.
    amp-59 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    458cafc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    278ffff View commit details
    Browse the repository at this point in the history

Commits on May 26, 2024

  1. Sema: Implemented slice casts, closes ziglang#20057.

    * Split `zirDivTrunc` into `zir*` and `analysis*` parts, so that the
      analysis part could be reused by `analyzeSlice2` when computing the
      new slice length.
    * Added explanation for the potential (currently unused) optimisation to
      overflow checks.
    amp-59 committed May 26, 2024
    Configuration menu
    Copy the full SHA
    a7f8cf7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3e848ae View commit details
    Browse the repository at this point in the history
  3. crash_report: Restored old panic. This settles the question of whether

                  the old interface can be removed all at once.
    amp-59 committed May 26, 2024
    Configuration menu
    Copy the full SHA
    e5af5aa View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    53b5879 View commit details
    Browse the repository at this point in the history
  5. builtin: Made panicImpl and panicImplData public, allowing the user

             to simply declare `pub const panic = std.builtin.panicImpl;` to define
             their preference.
    amp-59 committed May 26, 2024
    Configuration menu
    Copy the full SHA
    83d6c7e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2b568a4 View commit details
    Browse the repository at this point in the history
  7. Compilation: Handle error from deleteFile so that the desired

                 outcome (the file not existing) does not throw an error.
    
    main: As above.
    amp-59 committed May 26, 2024
    Configuration menu
    Copy the full SHA
    6949b3a View commit details
    Browse the repository at this point in the history
  8. fixup!

    amp-59 committed May 26, 2024
    Configuration menu
    Copy the full SHA
    61e4bf8 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2024

  1. builtin: Added to logic to determine the default panic interface mode.

             Data for `Debug`, otherwise simple.
    amp-59 committed May 27, 2024
    Configuration menu
    Copy the full SHA
    1ae4a73 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f3451dd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d57f82c View commit details
    Browse the repository at this point in the history