There's no need for an explicit prototype since stdlib.h is included via
indent_globs.h. Further, the explicit prototype was using an empty
parameter list missing the `name` argument that's present in the
stdlib.h prototype.
Previously pragma save_local_names was only used to store information of
variables of coroutines to be inspected by Python code. Extend this to
all local variables.
Standard struct definition where not usable in dynamic settings
(e.g. to_type()), as the definition was not registered to the corresponding
struct name and type.
Python can register global struct definitions via ldmud.register_struct().
Also added corresponding namespace ldmud.registered_structs that contains
all registered struct types.
Prototype-only functions are detected by looking at the first opcode of the
function. If the prototype has optional arguments, then the first bytes is
a jump table for argument initialization. The detection needs to look beyond
that.
For every prototype-only function the compiler creates a stub at the end that
throws the undefined function error. However this stub was missing the jump
table for optional arguments, writing the error opcode in its place instead.
This resulted in an invalid table and missing opcode after the table.
Both could result in a crash, depending on whether the function is called
with or without the optional argument.
Provide two implementations:
alists_sorted.c keeps alists with sorted key arrays. However this is restricted to LPC comparable types (numbers and strings) and homogeneous keys.
alists_unsorted.c implements alists without sorting the keys. If the Lib does not rely on ordered key arrays this implementation offers far superior performance for some operations.
The pattern leaked (Thanks, Daniel Nilsson for the fix).
An explicitly passed preposition array would leak.
Arguments were treated as unprotected lvalues, even though they are protected.
The cleanup routine was not called, thus leaking data in global variables.
The v2.12.0 release of libxml2 changed the definition of the callback
used with `xmlSetStructuredErrorFunc()`. This commit adjusts
`pkg-xml2.c` to support both the 2.12.0+ definition, as well as the
older one.
When pragma save_local_names was in effect, a former local variable could
lead to the compile error "Missing variable information" as the compiler
was trying to save that name as well.
In ed.c fix 'storing the address of local variable' by making the indentation
stack static. In bitstrings.c and comm.c fix 'variable set but not used'.
In md5.c GCC's warning of 'accessing 64 bytes in a region of size 15' seems
to be a false positivie, therefore disabling the warning there. In xalloc.c
disable GCC's warning of 'storing the address of local variable' as this
is intended for stack safety checks.
C23 changed the type of enumeration constants to be the same as the enum
type (instead of always being 'int'). This meant that now INHERIT_MASK is
regarded as being unsigned int, instead of (signed) int. As a consequence
functions that calculated the cross-definition offsets were losing the sign,
resulting in wrong offsets and potentially crashing.
When an action cannot be registered, the corresponding sent object will
be freed, but the deallocation function reads an uninitialised value
(the sent type). Therefore initializing the type early.