WASHINGTON — To combat the ills of the internet, federal lawmakers have increasingly focused on a decades-old law that shields tech companies like Facebook and YouTube from liability for content posted by their users.

Last year, lawmakers approved chipping away at the law, voting overwhelmingly for the Fight Online Sex Trafficking Act, which holds tech platforms accountable when people use their sites for sex-trafficking schemes. They have since floated other changes as well, like making Facebook or other platforms liable when opioids are sold on their sites.

But now, as the real-world effects of the sex-trafficking change take hold, some experts and politicians say the results are not all positive. And even some lawmakers who have championed a crackdown on Big Tech are now calling to revisit the change. On Tuesday, Senators Bernie Sanders of Vermont and Elizabeth Warren of Massachusetts, two of the tech industry’s loudest critics, joined 11 other lawmakers in backing a federal study of its effects.

Law enforcement officials say that it is sometimes more difficult to track traffickers, because the law pushed them further underground. Advocates say that sex workers now face higher safety risks. The removal of sites advertising sex hinders their ability to vet their clients, the advocates say, and is pushing more of them onto the streets.