Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Fix zero-len slice translations #12642

Merged
merged 1 commit into from
Oct 3, 2020

Conversation

jackcmay
Copy link
Contributor

@jackcmay jackcmay commented Oct 2, 2020

Problem

Zero-length vectors have not been allocated yet so calling as_ptr() returns address 0x1 which is not in the translation map and thus fails with an access violation

Summary of Changes

If translating a zero-length vector then don't attempt to translate

Fixes #

@jackcmay jackcmay added the v1.3 label Oct 2, 2020
@jackcmay jackcmay force-pushed the translate-zero-len-vec branch from ec39014 to a99cb9c Compare October 2, 2020 18:05
@jackcmay jackcmay added noCI Suppress CI on this Pull Request CI Pull Request is ready to enter CI and removed noCI Suppress CI on this Pull Request labels Oct 2, 2020
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Oct 2, 2020
@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #12642 into master will decrease coverage by 0.0%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           master   #12642     +/-   ##
=========================================
- Coverage    82.0%    82.0%   -0.1%     
=========================================
  Files         359      359             
  Lines       83832    83841      +9     
=========================================
- Hits        68784    68781      -3     
- Misses      15048    15060     +12     

@jackcmay jackcmay merged commit d0aa8a6 into solana-labs:master Oct 3, 2020
@jackcmay jackcmay deleted the translate-zero-len-vec branch October 3, 2020 00:45
mergify bot pushed a commit that referenced this pull request Oct 3, 2020
mergify bot added a commit that referenced this pull request Oct 3, 2020
(cherry picked from commit d0aa8a6)

Co-authored-by: Jack May <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants