Skip to content

Support for inline assembler & goto instructions in inline assembler#1326

Closed
WernerDrasche wants to merge 72 commits into
goblint:masterfrom
N0W0RK:master
Closed

Support for inline assembler & goto instructions in inline assembler#1326
WernerDrasche wants to merge 72 commits into
goblint:masterfrom
N0W0RK:master

Conversation

@WernerDrasche

@WernerDrasche WernerDrasche commented Jan 11, 2024

Copy link
Copy Markdown

Depends on goblint/cil#161.


The tests with annotations will come in very few days.
We are sorry for this (right now still) unpolished state.

Changes in goblint-cil:

  • asm is now statement
  • goto asm is parsed

Changes in analyzer: all changes are switched off by default and can be turned on by --disable asm_is_nop

  • CFG now has edges to labels referenced in goto asm label list
  • base emits new Invalidate {lvals} event (with the lvals of the out-clobbers)
  • We tried to the best of our abilities to handle this event and/or add asm transfer functions in the analyses where necessary

Simon Tietz and others added 30 commits November 17, 2023 17:09
Warns upon longjump to invalid Jumpbuf
Comment thread src/analyses/expsplit.ml Outdated
Comment thread src/analyses/memLeak.ml
| t , Blob n -> Blob (Blobs.invalidate_value ask t n)
| _ , Thread tid -> Thread (Threads.join (Threads.top ()) tid)
| _ , JmpBuf _ -> state (* TODO: no top jmpbuf *)
| _ , JmpBuf (b, c, _) -> JmpBuf(b, c, 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 comment should probably still remain, as we normally would have to do more here but just haven't gotten around to it yet.

Comment thread src/framework/constraints.ml Outdated
Simon Tietz and others added 2 commits February 1, 2024 11:43
end

let asm ctx outs ins =
if not !ignore_asm then begin

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.

Should the asm_is_top flag impact all analyses? If this check be moved into the mCP, so that it only needs to be done once?

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.

I think it probably should be at the FromSpec level even. And the top-level asm_is_nop option should probably be replaced with something more organized like sem.asm.nop.

@sim642 sim642 mentioned this pull request Feb 15, 2024
3 tasks
@sim642 sim642 modified the milestones: v2.4.0, v2.5.0 Jun 25, 2024
@sim642 sim642 modified the milestones: v2.5.0, v2.6.0 Nov 26, 2024
@sim642 sim642 modified the milestones: v2.6.0, v2.7.0 Jun 18, 2025
@sim642 sim642 mentioned this pull request Jun 26, 2026
2 tasks
@sim642 sim642 removed this from the v2.9.0 milestone Jun 26, 2026
@sim642

sim642 commented Jun 26, 2026

Copy link
Copy Markdown
Member

The asm goto part has been redone in #2067. The invalidation part is interesting but probably too out of date to still try to use, it's not too hard to redo.

@sim642 sim642 closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature pr-dependency Depends or builds on another PR, which should be merged before practical-course Practical Course at TUM student-job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants