summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-10 11:55:37 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-10 21:58:58 +0100
commit88b6428c25ea046a4bb19bb6f3f68dd4f1439539 (patch)
tree86eca67f4ffc83d5387590b0d502ecce7cc07b91 /Userland
parentcd49f30bea734feb9ac46d637e2ed3439e47e3c3 (diff)
downloadserenity-88b6428c25ea046a4bb19bb6f3f68dd4f1439539.zip
AK: Make Vector::try_* functions return ErrorOr<void>
Instead of signalling allocation failure with a bool return value (false), we now use ErrorOr<void> and return ENOMEM as appropriate. This allows us to use TRY() and MUST() with Vector. :^)
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h
index 4cf1a7d1dc..5f127365f8 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h
+++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h
@@ -311,7 +311,7 @@ public:
return false;
}
auto previous_size = m_elements.size();
- if (!m_elements.try_resize(new_size))
+ if (m_elements.try_resize(new_size).is_error())
return false;
for (size_t i = previous_size; i < m_elements.size(); ++i)
m_elements[i] = fill_value;