Skip to content

Natvis visualization for uint128 is wrong. #452

Description

@MarekKnapek

Execute the following program in the Microsoft Visual Studio 2026 with natvis loaded and observe contents of the locals window or the watch window.

#include <boost/int128.hpp>

int main()
{
	boost::int128::uint128_t a;
	boost::int128::uint128_t b;
	boost::int128::uint128_t c;
	boost::int128::uint128_t d;
	boost::int128::uint128_t e;
	boost::int128::uint128_t f;

	a.low  = 0x0000000000000000ull;
	a.high = 0x0000000000000000ull;

	b.low  = 0x0000000000000000ull + 42;
	b.high = 0x0000000000000000ull;

	c.low  = 0xffffffffffffffffull - 42;
	c.high = 0x0000000000000000ull;

	d.low  = 0x0000000000000000ull;
	d.high = 0x0000000000000000ull + 42;

	e.low  = 0xffffffffffffffffull;
	e.high = 0xffffffffffffffffull - 42;

	f.low  = 0xffffffffffffffffull;
	f.high = 0xffffffffffffffffull;

	__debugbreak();
}
  • The variable a contains the value of zero.
  • The variable b contains the value of 42.
  • The variable c contains the value of 42 before the great 2^64 boundary / barrier.
  • The variable d contains the value of 42 after the great 2^64 boundary / barrier.
  • The variable e contains the value of 42 before the absolute maximum.
  • The variable f contains the absolute maximum.

Also observe the following screenshot.

Image

Metadata

Metadata

Assignees

Labels

Boost ReviewFeedback from the review period including pre- and post- on the MLBugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions