Skip to content

Patched #1242#1293

Open
Yohello1 wants to merge 5 commits intoAliveToolkit:masterfrom
Yohello1:master
Open

Patched #1242#1293
Yohello1 wants to merge 5 commits intoAliveToolkit:masterfrom
Yohello1:master

Conversation

@Yohello1
Copy link
Copy Markdown

@Yohello1 Yohello1 commented Mar 5, 2026

Hello, Someone I know sent me this and said I should try patching it, took a quick jab at it and came up with this. Let me know if I missed anything, or am not properly following the coding standards.

Thank you,
Yohello1

uint64_t max_idx = blk_size - bytes + idx;
expr off = blk_offset + expr::mkUInt(idx, offset);
loaded[i].first.add(::raw_load(blk.val, off, max_idx), cond);
expr is_alive = isBlockAlive(bid, local);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing expr::mkUInt here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Should it be; expr is_alive = isBlockAlive(expr::mkUInt(bid, Pointer::bitsShortBid()), local);

@@ -0,0 +1,13 @@
; EXPECT: ERROR: Source is more defined than target
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the name of the test is not very good. this is testing that the load is not UB.
You need another test that shows that the return value can be replaced with poison. Also, run the tests; I believe some tests will fail with your change.


auto block_constraints = [&](const Pointer &p) {
expr ret = p.isBlockAlive();
expr ret = (iswrite || is_asm) ? p.isBlockAlive() : true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the iswrite condition only applies to stack variables.

@Yohello1
Copy link
Copy Markdown
Author

Yohello1 commented Apr 1, 2026

Hello, I made the changes, ran the tests, and got 82% failure rate... so be back in a bit.

@Yohello1
Copy link
Copy Markdown
Author

Yohello1 commented Apr 3, 2026

@nunoplopes Hi, I got the tests working and did find that a decent amount did fail. But it took me a while to figure out that Im supposed to run ninja check to run the tests, I also don't see it documented anywhere. Should we document it maybe in the README.md?

On the note of tests, here are the changes:

FIXED (1):

  • alive-tv/attrs/nocapture.src.ll

NEW FAILURES (5):

  • alive-tv/attrs/readnone-fail.srctgt.ll
  • alive-tv/bugs/pr23599.srctgt.ll
  • alive-tv/calls/escape2.srctgt.ll
  • alive-tv/calls/ptr-store.srctgt.ll
  • alive-tv/lifetime-load-poison.srctgt.ll

@nunoplopes
Copy link
Copy Markdown
Member

@nunoplopes Hi, I got the tests working and did find that a decent amount did fail. But it took me a while to figure out that Im supposed to run ninja check to run the tests, I also don't see it documented anywhere. Should we document it maybe in the README.md?

probably 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants