Skip to content

Conversation

@fosterbrereton
Copy link
Contributor

A couple hotfixes.

Description

  • Additional assertions in freader
  • Modified die_hash to be more accurate about what it includes when computing the die's hash.
  • Typo in evaluate_exprloc
  • "Better" block form handling. By "better" I mean we now throw an error if we see it, instead of treating it like an exprloc, which was definitely not right. I am working off of the hunch that an attribute that has a block form will not contribute to an ODR. I have added an exception in case such an attribute is encountered, at which point we'll likely need an expensive fix.
  • Added const_value to the list of nonfatal attributes.
Copy link
Contributor

@leethomason leethomason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one check in there. Nice set of fixes!


std::size_t size() const { return _l - _p; }
std::size_t size() const {
assert(*this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking: did you mean *this or this or this && *this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do mean *this. Because it is in an assert clause, that will require the compiler convert the expression to a boolean value. freader has an explicit operator bool that allows freader to convert to a boolean operation, and does so by performing a couple of checks to make sure the internal state of the instance is valid. So by writing assert(*this), we are asserting some necessary validity checks for pre/postconditions on a handful of the freader APIs.

@fosterbrereton fosterbrereton merged commit 5a3b6c5 into main Jan 9, 2024
@fosterbrereton fosterbrereton deleted the fosterbrereton/hotfixes branch January 9, 2024 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants