Commit graph

51769 commits

Author SHA1 Message Date
kleines Filmröllchen
dfd48ab643 LibAudio: Extract MP3 synchronize to static helper function
This comes in handy when we want to sniff an MP3 file with a stream
outside of the loader.
2023-06-27 15:28:22 +01:00
Andreas Kling
aec3d9d84e LibJS/Bytecode: Prefer alias over name in object pattern bindings
10 new passes on test262. :^)
2023-06-27 15:08:14 +02:00
Andreas Kling
1dc7f03137 LibJS: Have AsyncFunctionDriverWrapper unwrap promises before returning
24 new passes on test262. :^)
2023-06-27 13:48:27 +02:00
Daniel Bertalan
cc9ec6693b LibJS: Remove the concept of bytecode optimization levels
While this would be useful in the future for implementing a multi-tiered
optimization strategy, currently a binary on/off is enough for us. This
removes the confusingly on-by-default `OptimizationLevel::None` option
which made the optimization pipeline a no-op even if
`Bytecode::Interpreter::set_optimizations_enabled` had been called.

Fixes #15982
2023-06-27 14:35:23 +03:30
Daniel Bertalan
e012565898 test262-runner+js: Respect the bytecode optimizations enabled flag 2023-06-27 14:35:23 +03:30
Andrew Kaster
aa0ed4ab4e LibDebug: Keep track of the SetEpilogueBegin LineProgram OpCode
This prevents a crash with clang 16.
2023-06-27 12:40:38 +02:00
implicitfield
1e1fcb2ae7 Meta: Remove unused LLVM_VERSION declaration
All uses of this were removed in c4707ed.
2023-06-27 12:40:38 +02:00
implicitfield
941d68ac2d Toolchain+Ports: Update LLVM to 16.0.6 2023-06-27 12:40:38 +02:00
implicitfield
5dfe2eb389 Everywhere: Resolve conflicts with LibC and libc++
Since https://reviews.llvm.org/D131441, libc++ must be included before
LibC. As clang includes libc++ as one of the system includes, LibC
must be included after those, and the only correct way to do that is
to install LibC's headers into the sysroot.

Targets that don't link with LibC yet require its headers for one
reason or another must add install_libc_headers as a dependency to
ensure that the correct headers have been (re)installed into the
sysroot.

LibC/stddef.h has been dropped since the built-in stddef.h receives
a higher include priority.

In addition, string.h and wchar.h must
define __CORRECT_ISO_CPP_STRING_H_PROTO and
_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS respectively in order to tell
libc++ to not try to define methods implemented by LibC.
2023-06-27 12:40:38 +02:00
implicitfield
58c4e266e9 LibWeb: Prevent double promotion in paint_background 2023-06-27 12:40:38 +02:00
implicitfield
007f3cdb00 Everywhere: Remove exceptions for using #include <LibC/...>
Once LibC is installed to the sysroot and its conflicts with libc++
are resolved, including LibC headers in such a way will cause errors
with a modern LLVM-based toolchain.
2023-06-27 12:40:38 +02:00
implicitfield
79adeb626b LibC+LibELF: Move ELF definitions from LibC to LibELF
This is needed to avoid including LibC headers in Lagom builds.
Unfortunately, we cannot rely on the build machine to provide a
fully POSIX-compatible ELF header for Lagom builds, so we have to
use our own.
2023-06-27 12:40:38 +02:00
implicitfield
7d19abda7a LibC+LibRegex: Move regex_defs.h from LibC to LibRegex
This is needed to avoid including LibC headers in Lagom builds.
2023-06-27 12:40:38 +02:00
implicitfield
ec636a404b Meta: Make check-style.py complain if a non-AK complex header is used
LibC's complex.h should not be used in C++ code, and libc++'s version
implementation does not follow the Serenity C++ style.
2023-06-27 12:40:38 +02:00
implicitfield
cccb6c7287 LibC: Drop complex.cpp and move its definitions to complex.h
libc++ disallows including LibC's complex.h in C++ mode. This means that
a C++ file cannot expect LibC's complex.h to be included, and thus
cannot use c-prefixed complex number functions. As a result,
complex.cpp is broken when libc++ has a higher include priority
than LibC.

A check for __cplusplus has been added to complex.h to warn users of
toolchains that don't use libc++.
2023-06-27 12:40:38 +02:00
MacDue
1cc199d365 LibWeb: Prevent crash when inspecting SVG documents
(Or any document with aria-hidden=true on the root)
2023-06-27 09:20:06 +01:00
Andreas Kling
9430bbcc62 LibJS/Bytecode: Propagate FunctionDeclarationInstantiation exceptions
If an exception is thrown by FunctionDeclarationInstantiation for an
async or async-generator function, we still need to return a promise.
We can't just throw the exception.

81 new passes on test262. :^)
2023-06-27 00:21:52 +02:00
Andreas Kling
57404bae1f LibGfx: Return early from Painter::draw_line() if clip rect is empty 2023-06-26 20:28:42 +02:00
Nico Weber
3dd6638177 ICC: Strip trailing nul characters from MultiLocalizedUnicodeTagData
Having those trailing nuls is invalid per spec, but it happens in
practice (in already checked-in test files, no less).
2023-06-26 19:24:34 +01:00
Tim Ledbetter
dedbc17160 cut: Add -s option to suppress lines without field delimiters
If this option is not specified, lines that contain to field
delimiters will be printed unmodified.
2023-06-26 19:49:34 +02:00
Tim Ledbetter
e740489abd cut: Ignore trailing newline if present 2023-06-26 19:49:34 +02:00
Tim Ledbetter
da67d593d8 cut: Treat a range containing consecutive commas or dashes as invalid 2023-06-26 19:49:34 +02:00
Tim Ledbetter
bc56d71252 cut: Print the entire line if it contains no field delimiters 2023-06-26 19:49:34 +02:00
Tim Ledbetter
230a873e0e cut: Don't ignore empty fields 2023-06-26 19:49:34 +02:00
Tim Ledbetter
b17aa47769 usermod: Add -a and -r options to append or remove extra groups 2023-06-26 19:31:09 +02:00
Tim Ledbetter
caf55c0b2d usermod: Add -G option to modify supplementary groups 2023-06-26 19:31:09 +02:00
Tim Ledbetter
d7fccfc237 usermod: Allow group name or number to be used with the -g option 2023-06-26 19:31:09 +02:00
Tim Ledbetter
99f763cab3 usermod: Simplify uid validation 2023-06-26 19:31:09 +02:00
Tim Ledbetter
e86dd1cc89 usermod: Return error if -L and -U options are used simultaneously 2023-06-26 19:31:09 +02:00
Tim Ledbetter
089ff7b94e LibCore: Enable modification of a user's supplementary groups 2023-06-26 19:31:09 +02:00
Tim Ledbetter
ba34931620 strings: Don't bail immediately on error
Previously, strings would exit immediately if there was an error
changing file ownership. We now print an error to stderr and
continue when an error occurs.
2023-06-26 19:28:42 +02:00
Tim Ledbetter
c723101728 strings: Add -o option as an alias for -t o 2023-06-26 19:28:42 +02:00
Tim Ledbetter
a2fb0768ff strings: Add commonly used long option names for -n and -t 2023-06-26 19:28:42 +02:00
Tim Ledbetter
ab1e8a7b91 strings: Replace the -p option with the more commonly used -f
Previously, the `-p` option printed the path of the file being
processed before any strings for that file. The `-f` prints the file
path before each string . This matches the behavior of strings on
Linux and FreeBSD.
2023-06-26 19:28:42 +02:00
Tim Ledbetter
3de4cd0ba9 Base: Add man page for env 2023-06-26 19:27:45 +02:00
Tim Ledbetter
6aa87e2119 env: Add -u option to unset environment variables 2023-06-26 19:27:45 +02:00
Tim Ledbetter
b9e7998b53 LibC: Return EINVAL from unsetenv() if input is empty or contains "=" 2023-06-26 19:27:45 +02:00
Shannon Booth
d3a27eeaf2 LibDiff: Port Diff::Hunk from DeprecatedString to String
Removing the last instance of DeprecatedString in this library! :^)
2023-06-26 19:26:34 +02:00
Shannon Booth
9dc92f19b8 LibDiff: Port Diff::parse_hunks from DeprecatedString to StringView 2023-06-26 19:26:34 +02:00
Shannon Booth
c60150da15 HackStudio: Use StringView in DiffViewer::draw_line 2023-06-26 19:26:34 +02:00
Shannon Booth
ee92378b80 LibDiff: Make Diff::from_text fallible 2023-06-26 19:26:34 +02:00
Shannon Booth
23df5748f6 LibDiff: Make Diff::parse_hunks fallible
Currently the only error that can happen is an OOM. However, in the
future there may be other errors that this function may throw, such as
detecting an invalid patch.
2023-06-26 19:26:34 +02:00
Shannon Booth
dbd838efdf LibDiff: Replace DeprecatedString with StringView in parse_hunk_location 2023-06-26 19:26:34 +02:00
Shannon Booth
84e8ff34a2 diff: Use StringView instead of DeprecatedString 2023-06-26 19:26:34 +02:00
Tim Ledbetter
96fecc434c chgrp: Add support for multiple file paths 2023-06-26 19:26:20 +02:00
Andi Gallo
8afe5ce718 LibWeb: Fix min-content initialization for row measures
This ensures that min-content contributions from cells with no content
are computed using their calculated values, which are never considered
for min-content before then. The specification diverges from column
measures algorithm, which doesn't use specified width of cells anywhere.
2023-06-26 19:25:34 +02:00
Daniel Bertalan
5aef8f280f LibJS: Fix integer overflow in Number::exponentiate
The exponent might be larger than the range of values representable by
an i32, so we have to use the `fmod` function instead of the modulo
operator.

This fixes 3 test262 tests on AArch64. No changes on x86-64.
2023-06-26 19:25:12 +02:00
Andreas Kling
56fb5a3f5d LibJS/Bytecode: Ensure iterator is closed after array destructuring
If destructuring didn't exhaust the iterator, we have to manually close
the iterator.

49 new passes on test262. :^)
2023-06-26 19:18:06 +02:00
Andreas Kling
55531e5cda LibJS/Bytecode: Use LHS identifier as function name on logical assign
This now creates a function named `x`:

    x ||= function() { }

9 new passes on test262. :^)
2023-06-26 16:07:33 +02:00
Andreas Kling
17ba47558c LibWeb: Make a copy of Document's DocumentObserver set when iterating
The observer callbacks can do all kinds of things, so let's not be in
the middle of iterating the set in case someone decides to mutate it.

Fixes a crash when loading https://lichess.org/
2023-06-26 12:10:33 +02:00