[all-commits] [llvm/llvm-project] dffa28: [libc] Fix BigInt's operator %= (#98484)

Mikhail R. Gadelha via All-commits all-commits at lists.llvm.org
Thu Jul 11 07:44:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dffa28fa3a907a3e0c64c9b06a46b55fc5cea40a
      https://github.com/llvm/llvm-project/commit/dffa28fa3a907a3e0c64c9b06a46b55fc5cea40a
  Author: Mikhail R. Gadelha <mikhail at igalia.com>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M libc/src/__support/big_int.h

  Log Message:
  -----------
  [libc] Fix BigInt's operator %= (#98484)

This patch fixes cases where we try to do var %= 1. Previously this operator was calling .div directly since it would perform the inplace division and return the remainder, however, as an early exit condition a division by one returns zero as the remainder. The remainder being returned by div was not being assigned to var.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list