Skip to content

Commit

Permalink
Internally limit alignment to 2^30
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jul 8, 2017
1 parent da81a33 commit b4973e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ impl Align {
}
if bytes != 1 {
Err(format!("`{}` is not a power of 2", align))
} else if pow > 30 {
Err(format!("`{}` is too large", align))
} else {
Ok(pow)
}
Expand Down

0 comments on commit b4973e9

Please sign in to comment.