For the past four decades, a loophole in North Carolina sexual assault law made it impossible for a woman to revoke consent after a sex act had begun.

Another loophole, a result of a 2008 court ruling, made it legal to have sex with someone who is incapacitated if that person’s condition was caused by his or her actions — like consuming drugs or alcohol.

Lawmakers in the State Senate and House of Representatives, which are both controlled by Republicans, unanimously approved a wide-ranging sexual assault bill on Thursday that would close those loopholes. Gov. Roy Cooper, a Democrat, is expected to sign it into law.

“It’s a big win for basic decency,” said Jeff Jackson , a Democratic state senator who represents Mecklenburg County. “We’re no longer the only state in the country where a woman doesn’t have a legal right to revoke her consent.”