Skip to content

Commit

Permalink
Merge pull request EOSIO#38 from EOSIO/release/1.1.x
Browse files Browse the repository at this point in the history
Release/1.1.x
  • Loading branch information
larryk85 authored Aug 7, 2018
2 parents 55bf300 + a4d6e95 commit 32baafc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(eosio_wasm_sdk)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WasmSDK
## Version : 1.1.0
## Version : 1.1.1

WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that the SDK has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete.

Expand Down
11 changes: 7 additions & 4 deletions libraries/eosiolib/asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ namespace eosio {
* @post The amount of this asset is multiplied by a
*/
asset& operator*=( int64_t a ) {
eosio_assert( a == 0 || (amount * a) / a == amount, "multiplication overflow or underflow" );
amount *= a;
eosio_assert( -max_amount <= amount, "multiplication underflow" );
eosio_assert( amount <= max_amount, "multiplication overflow" );
int128_t tmp = (int128_t)amount * (int128_t)a;
eosio_assert( tmp <= max_amount, "multiplication overflow" );
eosio_assert( tmp >= -max_amount, "multiplication underflow" );
amount = (int64_t)tmp;
return *this;
}

Expand Down Expand Up @@ -218,6 +218,8 @@ namespace eosio {
* @post The amount of this asset is divided by a
*/
asset& operator/=( int64_t a ) {
eosio_assert( a != 0, "divide by zero" );
eosio_assert( !(amount == std::numeric_limits<int64_t>::min() && a == -1), "signed division overflow" );
amount /= a;
return *this;
}
Expand Down Expand Up @@ -246,6 +248,7 @@ namespace eosio {
* @pre Both asset must have the same symbol
*/
friend int64_t operator/( const asset& a, const asset& b ) {
eosio_assert( b.amount != 0, "divide by zero" );
eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" );
return a.amount / b.amount;
}
Expand Down

0 comments on commit 32baafc

Please sign in to comment.