mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
girnode: Improve int types in GIIrNodeField
`GIIrNodeField` is built dynamically at runtime (rather than being
mmapped from disk), so its types can accurately reflect their runtime
semantics, rather than an on-disk format.
As part of this, switch from `atoi()` to `g_ascii_string_to_unsigned()`
for parsing the relevant fields from a GIR XML file. This means we now
get error handling for invalid integers.
This also includes some offset validity changes which were forgotten
from commit 515b3fc1dc
.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3155
This commit is contained in:
@@ -1601,7 +1601,7 @@ gi_ir_node_build_typelib (GIIrNode *node,
|
||||
blob->writable = field->writable;
|
||||
blob->reserved = 0;
|
||||
blob->bits = 0;
|
||||
if (field->offset >= 0)
|
||||
if (field->offset_state == GI_IR_OFFSETS_COMPUTED)
|
||||
blob->struct_offset = field->offset;
|
||||
else
|
||||
blob->struct_offset = 0xFFFF; /* mark as unknown */
|
||||
|
Reference in New Issue
Block a user