From Jonne Ransijn to ~mpu/qbe
> I would love to know whether this is an issue I caused due to > incompetence or due to QBE screwing up codegen. AND with an immediate does not support shifting, so definitely a QBE codegen bug: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/AND--immediate-?lang=en
From Jonne Ransijn to ~mpu/qbe
On 5/3/24 22:13, Quentin Carbonneaux wrote: > I need more context here. What is the intended use > case? What does it do on the various targets? Visibility is typically used to show/hide symbols from dynamic libraries. Both ELF and PE support this. I believe the default for ELF is to show all symbols, and for PE (`.dll` files) to hide them all. "hidden" symbols can only be accessed from other functions inside the dynamic library, while "visible" symbols can be accessed from any code unit linked with the dynamic library. I believe MSVC wants a separate `.def` file containing the "visible" symbols, and Finxx' patch gives a way to generate those with `dlltool`.
From Jonne Ransijn to ~mpu/qbe
On 30/04/2024 02:44, Nguyễn Gia Phong wrote: > I wonder if help2man is net-beneficial in this case. There is also [scdoc][1] for simple, human-written man pages. [1]: https://git.sr.ht/~sircmpwn/scdoc
From Jonne Ransijn to ~mpu/qbe
Oh, and for MacOS, seems like the symbol is named `__stdinp`: $ grep stdin /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h extern FILE *__stdinp; #define stdin __stdinp
From Jonne Ransijn to ~mpu/qbe
> I, of course, did try to think logically and see if `stdin` would just be a symbol defined with a global sigil, but it isn’t. Are you perhaps running on Windows? I've had a similar problem. On Windows, `stdin` is defined as such: extern FILE _iob[]; #define stdin (&_iob[0]) You would have to call `fgets` like so: %out_2 =l copy $input_3
From Jonne Ransijn to ~mpu/qbe
Hi - I am working on a QBE parser/serializer implementation.
While testing, I ran into an incompatibility with QBE.
QBE accepts duplicate parameter names, but my implementation does not.
This is because it stores parameter types in a hash map.
Examples:
```qbe
function $x(l %a, d %a) { ... } # different class, same size
function $x(l %a, w %a) { ... } # same class, different size
function $x(l %a, :one %a) { ... } # same class, same size
function $x(l %a, l %a) { ... } # same type
```
[message trimmed]
From Jonne Ransijn to ~sircmpwn/sr.ht-dev
The Blame URLs returned by `url_for` currently return e.g. `b'master'` for the ref component, breaking the "Blame" tab. Example: https://git.sr.ht/~yyny/test/blame/b%27master%27/README.md This patch fixes that. --- gitsrht/blueprints/repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 11418c3..3b7c10a 100644 --- a/gitsrht/blueprints/repo.py [message trimmed]
From Jonne Ransijn to ~mpu/qbe
> I'd like to keep syntactic sugar out of the IL. A respectable choice. > I suggest you have a single way of emitting loads and stores I have exactly that, but they operate on syntax nodes. There are a few places in the codegen that implicitly load a field. (Examples: Bounds checking, tagged unions) > and maybe add a comment in the generated IL that makes it clear for > you what's happening. I initially solved my problem by _removing_ all comments and rewriting
From Jonne Ransijn to ~mpu/qbe
---
This has been my no. 1 pain point with QBE. Debugging invalid loads and
stores has caused me many problems because the add (and mul)
instructions to calculate the address are interleaved.
The syntax is limited to loads and stores because adding constants to
non-addresses is usually specified explicitly in the front-end.
+%b
+%b*N
would be nice too, but +N deals with the most common case of
a static field access, and this syntax is also already supported in
'data' definitions aswell.
[message trimmed]
From Jonne Ransijn to ~sircmpwn/sr.ht-dev
--- Fix the PATCH line This fixes the XSS vulnerability mentioned by Umar Getagazov gitsrht/blueprints/repo.py | 9 +++++++-- gitsrht/templates/utils.html | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 230a5f1..ef379b2 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -6,7 +6,7 @@ import pygments import subprocess [message trimmed]