[Lilliput/JDK17] Fix OptoRuntime::new_array_nozero_C

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • None
    • Affects Version/s: repo-lilliput-17
    • Component/s: hotspot
    • generic
    • generic

      There's a severe bug in OptoRuntime::new_array_nozero_C() where we could end up clearing other memory because we add a byte-sized offset to a pointer base:

      ```
          HeapWord* obj = cast_from_oop<HeapWord*>(result);
          if (aligned_hs_bytes > hs_bytes) {
            Copy::zero_to_bytes(obj + hs_bytes, aligned_hs_bytes - hs_bytes);
          }
      ```

            Assignee:
            Roman Kennke
            Reporter:
            Roman Kennke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: