Commit graph

31235 commits

Author SHA1 Message Date
Hendiadyoin1 b39c4c62d0 AK: Use StringView as key-type when removing a Value from an JsonObject 2021-12-15 23:35:14 -08:00
Hendiadyoin1 e35709cbd2 AK: Return bool in JsonValue::as_bool() 2021-12-15 23:35:14 -08:00
Hendiadyoin1 e5cf395a54 Kernel: Collapse blocking logic for exclusive Mutex' restore_lock()
Clang-tidy pointed out that the `need_to_block = true;` block was
duplicate, and if we collapse these if statements, we should do so
fully.
2021-12-15 23:34:11 -08:00
Hendiadyoin1 1ad4a190b5 Kernel: Add implied auto-specifiers in Locking
As per clang-tidy.
2021-12-15 23:34:11 -08:00
Hendiadyoin1 a7209ca0f9 Kernel: Add missing includes in Locking 2021-12-15 23:34:11 -08:00
Hendiadyoin1 30458a6600 Kernel: Remove duplicate access specifier in DevTmpFSInode
As per clang-tidy.
2021-12-15 23:34:11 -08:00
Hendiadyoin1 47a39e425c Kernel: Remove else statements after return in Plan9FileSystem.cpp
As per clang-tidy.
2021-12-15 23:34:11 -08:00
Hendiadyoin1 4cec16a713 Kernel: Add implied auto-specifiers in FileSystem
As per clang-tidy.
2021-12-15 23:34:11 -08:00
Hendiadyoin1 fe2cf774c3 Kernel: Fix missing include in FileSystem/Mount.h 2021-12-15 23:34:11 -08:00
Ali Mohammad Pur 9bf81463f5 Shell: Don't skip over the first brace expansion entry if it's empty
Previously we were simply ignoring the empty entry in '{,x}', making it
resolve to a list with a single element '(x)', this commit makes that
work as expected and resolve to '("" x)'.
2021-12-16 03:26:59 +03:30
Ali Mohammad Pur 7ac8bd44f8 Shell: Set subshell flag after checking for its value in parent shell
This also reverts commit 07cc7eed29, as
that attempted to fix the issue this caused (and succeeded...but it
broke something else on linux).
2021-12-16 03:26:59 +03:30
Ali Mohammad Pur 4458cc249e LibLine: Switch all files to use east-const 2021-12-16 03:26:59 +03:30
Ali Mohammad Pur 2338d5fcda LibLine: Update the prompt origin after resize + suggestion redisplay 2021-12-16 03:26:59 +03:30
Ali Mohammad Pur 86e1d1e73d LibLine: Take the prompt into account when adjusting for a scrolled view
Otherwise we'd end up putting the prompt *after* the previous prompt
instead of *over* it when showing suggestions that span more lines than
are available without scrolling.
2021-12-16 03:26:59 +03:30
RasmusNylander fa99125571 Spreadsheet: Handle emptying of cell containing only an '='
Cell::set_data(String new_data) now checks whether the cell is a
formula-cell and the new_data is an empty string. If this is case, it
will no longer simply return and will now instead actually set the
cell's contents to an empty string.

This fixes an error whereupon committing the string "=" to a cell, it
would not be possible to directly delete the cell's contents. Instead,
it first had to be overwritten with another string, which then could be
deleted.

This could probably be done more elegantly. Right now, I believe,
writing the string "=" to a (formula-)cell already containing an
identical string will result in the cell being marked as dirty, even
though nothing actually changed.
2021-12-16 02:44:37 +03:30
Simon Woertz c2df6b597a Lagom: Add argument WORKING_DIRECTORY to lagom_test(...)
So far the working directory was set in some cases using
`set_tests_properties(...)`, but this requires to know which name is
picked by `lagom_test(...)` when calling `add_test(...)`.
In case of adding multiple test cases using a globbing pattern this
would require to duplicate code to construct the test name from the file
name.
2021-12-15 10:33:27 -08:00
Andrew Kaster 7e04160b0b LibSanitizer: Log UBSAN errors in red text to the debug console
This makes them harder to miss for spammy apps when UBSAN is not deadly.

Don't commit to making the warnln red at the momment, because that would
probably be a nuisance if stderr is not a tty.
2021-12-15 10:30:32 -08:00
Andrew Kaster db33cdbc2f AK+LibSanitizer: Add method to zero out a UBSAN SourceLocation
This is the same strategy that LLVM's compiler-rt uses to make sure that
each UBSAN error is only reported once, when UBSAN is *not* deadly.

Otherwise, each time we head through a UB codepath, we will log the same
error over and over. That behavior just adds noise to the logs and makes
it nearly impossible to run binaires that have some common code path
with flagged UB in them.

compiler-rt goes the extra step to make sure the "clear" action is
atomic, but we don't really have that many multi-threaded apps gettting
tested with UBSAN yet, so we can add that later.
2021-12-15 10:30:32 -08:00
Andrew Kaster 3e9fb9f23c LibSanitizer: Check for halt_on_error=0 in $UBSAN_OPTIONS
This allows a developer to set the g_ubsan_is_deadly flag to true by
default and still disable UBSAN for certain applications.
2021-12-15 10:30:32 -08:00
Daniel Bertalan 815f15f82c LibDebug: Handle DWARF 4 address ranges
The format of the address range section is different between DWARF
version 4 and version 5. This meant that we parsed programs compiled
with `-gdwarf-4` incorrectly.
2021-12-15 10:27:12 -08:00
Daniel Bertalan 7546295abe LibDebug: Fix truncation in ExtendedOpcodes::SetDiscriminator
The parameter of this operator is an unsigned LEB128 integer, so it can
be more than 1 byte in length. If we only read 1 byte, we might mess up
the offsets for the instructions following it.
2021-12-15 10:27:12 -08:00
Lady Gegga d3f5416b70 Base: Add some Mongolian characters to font Katica Regular 10
1801-180A, 1820, 1821, 1830-1833, 1841-1843, 1850-1852, 1860-1862,
1880-1884
https://www.unicode.org/charts/PDF/U1800.pdf
2021-12-15 10:20:57 -08:00
Ali Mohammad Pur d2e51fafa9 LibRegex: Merge alternations based on blocks and not instructions
The instructions can have dependencies (e.g. Repeat), so only unify
equal blocks instead of consecutive instructions.
Fixes #11247.

Also adds the minimal test case(s) from that issue.
2021-12-15 19:36:45 +03:30
Timothy Flynn 92233660b8 LibUnicode: Compile generated sources optimized for size
This breaks LibUnicode into two libraries: LibUnicode containing the
public APIs for accessing the library, and LibUnicodeData containing the
generated source files. LibUnicodeData has compile options optimized for
size, which save about 1MB of data in total.
2021-12-15 13:26:03 +00:00
Ali Mohammad Pur ed9c79e131 LibWeb: Use ByteBuffer::copy() instead of a manual copy in SubtleCrypto
Also use the HashManager(HashKind) constructor instead of the default
constructor + manual initialize() call.
2021-12-15 12:54:34 +00:00
Hendiadyoin1 422b624743 AK: Convert JsonObject to use StringViews for lookup
Most of the Keys we use are compile-time strings anyway, there is no
need to use the heap to pass them around.
2021-12-15 13:09:49 +03:30
Hendiadyoin1 d50360f5dd AK: Allow hash-compatible key types in Hash[Table|Map] lookup
This will allow us to avoid some potentially expensive type conversion
during lookup, like form String to StringView, which would allocate
memory otherwise.
2021-12-15 13:09:49 +03:30
Hendiadyoin1 c8bee92fb9 AK: Add the concept of hash-compatible types 2021-12-15 13:09:49 +03:30
Hendiadyoin1 92e824afa1 AK: Add a Concept for any String type 2021-12-15 13:09:49 +03:30
Hendiadyoin1 6c6e917cf0 AK: Add dedicated Traits for c-strings 2021-12-15 13:09:49 +03:30
Hendiadyoin1 dea86f511c LibC: Use FlatPtr for malloced char* address storage
This would break with the next commit, after which char* will always be
treated as c-strings.
2021-12-15 13:09:49 +03:30
Hendiadyoin1 ceb0e28ea5 AK: Add helper to test for pointer and cv-pointer at the same time 2021-12-15 13:09:49 +03:30
Hendiadyoin1 dfe2cf3a40 AK: Add a Decay helper for Concepts 2021-12-15 13:09:49 +03:30
Lady Gegga b7d19476f2 Base: Add remaining Vai characters to font Katica Regular 10
A5D3-A62B https://www.unicode.org/charts/PDF/UA500.pdf
2021-12-14 22:54:07 -08:00
Linus Groh 5f993eecdb LibWeb: Replace incorrect empty Optional return with ByteBuffer
This function initially returned a ByteBuffer, so `return {}` was fine.
It was then changed to return Optional<ByteBuffer>, so we accidentally
started returning an empty Optional instead. Explicitly specify the
constructor name to fix this.

Thanks to DexesTTP for catching this!
2021-12-14 19:49:15 +00:00
Astraeus- 9090dea1e2 Documentation: Fix spelling error
"SourceLocatin" -> "SourceLocation"
2021-12-14 15:05:16 +00:00
Linus Groh 69fe4c2aca LibWeb: Remove dbgln() left from debugging :^) 2021-12-14 08:58:13 +00:00
Liav A ac7953f945 Kernel: Allow switching to IOAPIC mode even without enabling SMP
This small change allows to use the IOAPIC by default without to enable
SMP mode, which emulates Uni-Processor setup with IOAPIC instead of
using the PIC.

This opens the opportunity to utilize other types of interrupts like MSI
and MSI-X interrupts.
2021-12-14 09:02:06 +01:00
Liav A f57900a41b Kernel/Interrupts: Add ByteReaders to read possible unaligned MADT data
The MADT data could be on unaligned boundary - for example, a GSI number
(u32) on unaligned address which leads to a KUBSAN error and halting the
system.
2021-12-14 09:02:06 +01:00
Liav A bbdb55126c Kernel/SysFS: Don't allocate ACPISysFS components in constructors
Instead defer it to a method to be called after the construction of
ACPISysFSDirectory.
2021-12-14 09:01:33 +01:00
Liav A 381fdaa163 Kernel/SysFS: Make it clear that some components must be created in boot
Using the phrase "create" doesn't give information on whether the object
must be allocated or a failure to do so can be handled gracefully.
Therefore, we must use better phrase for such purpose, so "must_create"
for the allocate-and-construct static methods is definitely good choice.
2021-12-14 09:01:33 +01:00
Liav A 478f543899 Kernel/SysFS: Prevent allocation for component name during construction
Instead, allocate before constructing the object and pass NonnullOwnPtr
of KString to the object if needed. Some classes can determine their
names as they have a known attribute to look for or have a static name.
2021-12-14 09:01:33 +01:00
Linus Groh 4daf07e69f LibWeb: Implement SubtleCrypto.digest()
This is a simple implementation of SubtleCrypto.digest() using LibCrypto
under the hood, so it supports all the required hash functions:
SHA-1, SHA-256, SHA-384, SHA-512.

Two FIXMEs remain: doing the hashing "in parallel", and supporting an
object argument instead of a plain string.
2021-12-14 09:01:06 +01:00
Linus Groh 5e06d5e9e5 LibWeb: Implement "get a copy of the bytes held by the buffer source" 2021-12-14 09:01:06 +01:00
Linus Groh 976ab23b9c LibWeb: Add support for the BufferSource IDL parameter type 2021-12-14 09:01:06 +01:00
Linus Groh 841bd680fa LibJS: Add ArrayBuffer::create() for ByteBuffer passed by value 2021-12-14 09:01:06 +01:00
Linus Groh 615be9eb7c LibWeb: Add the SubtleCrypto interface
Just some boilerplate code to get started :^)
This adds both the SubtleCrypto constructor to the window object, as
well as the crypto.subtle instance attribute.
2021-12-14 09:01:06 +01:00
Timothy Flynn ce6c515873 LibUnicode: Generate unique list patterns and lists of list patterns 2021-12-13 21:28:56 -08:00
Timothy Flynn 0ad2decd04 LibUnicode: Generate unique list of keyword values 2021-12-13 21:28:56 -08:00
Timothy Flynn 0c6cc4ad96 LibUnicode: Generate unique lists of localized currencies 2021-12-13 21:28:56 -08:00